<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html><head><title>QGraphicsItem Class Reference</title><style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
td.postheader { font-family: sans-serif }
tr.address { font-family: sans-serif }
body { background: #ffffff; color: black; }
</style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><td width="1">&#160;&#160;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&#160;&#183; <a href="classes.html"><font color="#004faf">All Classes</font></a>&#160;&#183; <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QGraphicsItem Class Reference<br /><sup><sup>[<a href="qtgui.html">QtGui</a> module]</sup></sup></h1><p>The QGraphicsItem class is the base class for all graphical
items in a <a href="qgraphicsscene.html">QGraphicsScene</a>.
<a href="#details">More...</a></p>

<p>Inherited by <a href="qabstractgraphicsshapeitem.html">QAbstractGraphicsShapeItem</a>, <a href="qgraphicsitemgroup.html">QGraphicsItemGroup</a>, <a href="qgraphicslineitem.html">QGraphicsLineItem</a>, <a href="qgraphicsobject.html">QGraphicsObject</a> and <a href="qgraphicspixmapitem.html">QGraphicsPixmapItem</a>.</p><h3>Types</h3><ul><li><div class="fn" />enum <b><a href="qgraphicsitem.html#CacheMode-enum">CacheMode</a></b> { NoCache, ItemCoordinateCache, DeviceCoordinateCache }</li><li><div class="fn" />enum <b><a href="qgraphicsitem.html#GraphicsItemChange-enum">GraphicsItemChange</a></b> { ItemPositionChange, ItemMatrixChange, ItemVisibleChange, ItemEnabledChange, ..., ItemTransformOriginPointHasChanged }</li><li><div class="fn" />enum <b><a href="qgraphicsitem.html#GraphicsItemFlag-enum">GraphicsItemFlag</a></b> { ItemIsMovable, ItemIsSelectable, ItemIsFocusable, ItemClipsToShape, ..., ItemSendsScenePositionChanges }</li><li><div class="fn" />class <b><a href="qgraphicsitem-graphicsitemflags.html">GraphicsItemFlags</a></b></li><li><div class="fn" />enum <b><a href="qgraphicsitem.html#PanelModality-enum">PanelModality</a></b> { NonModal, PanelModal, SceneModal }</li></ul><h3>Methods</h3><ul><li><div class="fn" /><b><a href="qgraphicsitem.html#QGraphicsItem">__init__</a></b> (<i>self</i>, QGraphicsItem&#160;<i>parent</i>&#160;=&#160;None, QGraphicsScene&#160;<i>scene</i>&#160;=&#160;None)</li><li><div class="fn" />bool <b><a href="qgraphicsitem.html#acceptDrops">acceptDrops</a></b> (<i>self</i>)</li><li><div class="fn" />Qt.MouseButtons <b><a href="qgraphicsitem.html#acceptedMouseButtons">acceptedMouseButtons</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qgraphicsitem.html#acceptHoverEvents">acceptHoverEvents</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qgraphicsitem.html#acceptsHoverEvents">acceptsHoverEvents</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qgraphicsitem.html#acceptTouchEvents">acceptTouchEvents</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#advance">advance</a></b> (<i>self</i>, int&#160;<i>phase</i>)</li><li><div class="fn" />QRectF <b><a href="qgraphicsitem.html#boundingRect">boundingRect</a></b> (<i>self</i>)</li><li><div class="fn" />QRegion <b><a href="qgraphicsitem.html#boundingRegion">boundingRegion</a></b> (<i>self</i>, QTransform&#160;<i>itemToDeviceTransform</i>)</li><li><div class="fn" />float <b><a href="qgraphicsitem.html#boundingRegionGranularity">boundingRegionGranularity</a></b> (<i>self</i>)</li><li><div class="fn" />CacheMode <b><a href="qgraphicsitem.html#cacheMode">cacheMode</a></b> (<i>self</i>)</li><li><div class="fn" />list-of-QGraphicsItem <b><a href="qgraphicsitem.html#childItems">childItems</a></b> (<i>self</i>)</li><li><div class="fn" />QRectF <b><a href="qgraphicsitem.html#childrenBoundingRect">childrenBoundingRect</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#clearFocus">clearFocus</a></b> (<i>self</i>)</li><li><div class="fn" />QPainterPath <b><a href="qgraphicsitem.html#clipPath">clipPath</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qgraphicsitem.html#collidesWithItem">collidesWithItem</a></b> (<i>self</i>, QGraphicsItem&#160;<i>other</i>, Qt.ItemSelectionMode&#160;<i>mode</i>&#160;=&#160;Qt.IntersectsItemShape)</li><li><div class="fn" />bool <b><a href="qgraphicsitem.html#collidesWithPath">collidesWithPath</a></b> (<i>self</i>, QPainterPath&#160;<i>path</i>, Qt.ItemSelectionMode&#160;<i>mode</i>&#160;=&#160;Qt.IntersectsItemShape)</li><li><div class="fn" />list-of-QGraphicsItem <b><a href="qgraphicsitem.html#collidingItems">collidingItems</a></b> (<i>self</i>, Qt.ItemSelectionMode&#160;<i>mode</i>&#160;=&#160;Qt.IntersectsItemShape)</li><li><div class="fn" />QGraphicsItem <b><a href="qgraphicsitem.html#commonAncestorItem">commonAncestorItem</a></b> (<i>self</i>, QGraphicsItem&#160;<i>other</i>)</li><li><div class="fn" />bool <b><a href="qgraphicsitem.html#contains">contains</a></b> (<i>self</i>, QPointF&#160;<i>point</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#contextMenuEvent">contextMenuEvent</a></b> (<i>self</i>, QGraphicsSceneContextMenuEvent&#160;<i>event</i>)</li><li><div class="fn" />QCursor <b><a href="qgraphicsitem.html#cursor">cursor</a></b> (<i>self</i>)</li><li><div class="fn" />QVariant <b><a href="qgraphicsitem.html#data">data</a></b> (<i>self</i>, int&#160;<i>key</i>)</li><li><div class="fn" />QTransform <b><a href="qgraphicsitem.html#deviceTransform">deviceTransform</a></b> (<i>self</i>, QTransform&#160;<i>viewportTransform</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#dragEnterEvent">dragEnterEvent</a></b> (<i>self</i>, QGraphicsSceneDragDropEvent&#160;<i>event</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#dragLeaveEvent">dragLeaveEvent</a></b> (<i>self</i>, QGraphicsSceneDragDropEvent&#160;<i>event</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#dragMoveEvent">dragMoveEvent</a></b> (<i>self</i>, QGraphicsSceneDragDropEvent&#160;<i>event</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#dropEvent">dropEvent</a></b> (<i>self</i>, QGraphicsSceneDragDropEvent&#160;<i>event</i>)</li><li><div class="fn" />float <b><a href="qgraphicsitem.html#effectiveOpacity">effectiveOpacity</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#ensureVisible">ensureVisible</a></b> (<i>self</i>, QRectF&#160;<i>rect</i>&#160;=&#160;QRectF(), int&#160;<i>xMargin</i>&#160;=&#160;50, int&#160;<i>yMargin</i>&#160;=&#160;50)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#ensureVisible-2">ensureVisible</a></b> (<i>self</i>, float&#160;<i>x</i>, float&#160;<i>y</i>, float&#160;<i>w</i>, float&#160;<i>h</i>, int&#160;<i>xMargin</i>&#160;=&#160;50, int&#160;<i>yMargin</i>&#160;=&#160;50)</li><li><div class="fn" />bool <b><a href="qgraphicsitem.html#filtersChildEvents">filtersChildEvents</a></b> (<i>self</i>)</li><li><div class="fn" />GraphicsItemFlags <b><a href="qgraphicsitem.html#flags">flags</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#focusInEvent">focusInEvent</a></b> (<i>self</i>, QFocusEvent&#160;<i>event</i>)</li><li><div class="fn" />QGraphicsItem <b><a href="qgraphicsitem.html#focusItem">focusItem</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#focusOutEvent">focusOutEvent</a></b> (<i>self</i>, QFocusEvent&#160;<i>event</i>)</li><li><div class="fn" />QGraphicsItem <b><a href="qgraphicsitem.html#focusProxy">focusProxy</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#grabKeyboard">grabKeyboard</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#grabMouse">grabMouse</a></b> (<i>self</i>)</li><li><div class="fn" />QGraphicsEffect <b><a href="qgraphicsitem.html#graphicsEffect">graphicsEffect</a></b> (<i>self</i>)</li><li><div class="fn" />QGraphicsItemGroup <b><a href="qgraphicsitem.html#group">group</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qgraphicsitem.html#handlesChildEvents">handlesChildEvents</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qgraphicsitem.html#hasCursor">hasCursor</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qgraphicsitem.html#hasFocus">hasFocus</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#hide">hide</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#hoverEnterEvent">hoverEnterEvent</a></b> (<i>self</i>, QGraphicsSceneHoverEvent&#160;<i>event</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#hoverLeaveEvent">hoverLeaveEvent</a></b> (<i>self</i>, QGraphicsSceneHoverEvent&#160;<i>event</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#hoverMoveEvent">hoverMoveEvent</a></b> (<i>self</i>, QGraphicsSceneHoverEvent&#160;<i>event</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#inputMethodEvent">inputMethodEvent</a></b> (<i>self</i>, QInputMethodEvent&#160;<i>event</i>)</li><li><div class="fn" />Qt.InputMethodHints <b><a href="qgraphicsitem.html#inputMethodHints">inputMethodHints</a></b> (<i>self</i>)</li><li><div class="fn" />QVariant <b><a href="qgraphicsitem.html#inputMethodQuery">inputMethodQuery</a></b> (<i>self</i>, Qt.InputMethodQuery&#160;<i>query</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#installSceneEventFilter">installSceneEventFilter</a></b> (<i>self</i>, QGraphicsItem&#160;<i>filterItem</i>)</li><li><div class="fn" />bool <b><a href="qgraphicsitem.html#isActive">isActive</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qgraphicsitem.html#isAncestorOf">isAncestorOf</a></b> (<i>self</i>, QGraphicsItem&#160;<i>child</i>)</li><li><div class="fn" />(bool, QGraphicsItem&#160;<i>blockingPanel</i>) <b><a href="qgraphicsitem.html#isBlockedByModalPanel">isBlockedByModalPanel</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qgraphicsitem.html#isClipped">isClipped</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qgraphicsitem.html#isEnabled">isEnabled</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qgraphicsitem.html#isObscured">isObscured</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qgraphicsitem.html#isObscured-2">isObscured</a></b> (<i>self</i>, QRectF&#160;<i>rect</i>)</li><li><div class="fn" />bool <b><a href="qgraphicsitem.html#isObscured-3">isObscured</a></b> (<i>self</i>, float&#160;<i>ax</i>, float&#160;<i>ay</i>, float&#160;<i>w</i>, float&#160;<i>h</i>)</li><li><div class="fn" />bool <b><a href="qgraphicsitem.html#isObscuredBy">isObscuredBy</a></b> (<i>self</i>, QGraphicsItem&#160;<i>item</i>)</li><li><div class="fn" />bool <b><a href="qgraphicsitem.html#isPanel">isPanel</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qgraphicsitem.html#isSelected">isSelected</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qgraphicsitem.html#isUnderMouse">isUnderMouse</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qgraphicsitem.html#isVisible">isVisible</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qgraphicsitem.html#isVisibleTo">isVisibleTo</a></b> (<i>self</i>, QGraphicsItem&#160;<i>parent</i>)</li><li><div class="fn" />bool <b><a href="qgraphicsitem.html#isWidget">isWidget</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qgraphicsitem.html#isWindow">isWindow</a></b> (<i>self</i>)</li><li><div class="fn" />QVariant <b><a href="qgraphicsitem.html#itemChange">itemChange</a></b> (<i>self</i>, GraphicsItemChange&#160;<i>change</i>, QVariant&#160;<i>value</i>)</li><li><div class="fn" />(QTransform, bool&#160;<i>ok</i>) <b><a href="qgraphicsitem.html#itemTransform">itemTransform</a></b> (<i>self</i>, QGraphicsItem&#160;<i>other</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#keyPressEvent">keyPressEvent</a></b> (<i>self</i>, QKeyEvent&#160;<i>event</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#keyReleaseEvent">keyReleaseEvent</a></b> (<i>self</i>, QKeyEvent&#160;<i>event</i>)</li><li><div class="fn" />QPointF <b><a href="qgraphicsitem.html#mapFromItem">mapFromItem</a></b> (<i>self</i>, QGraphicsItem&#160;<i>item</i>, QPointF&#160;<i>point</i>)</li><li><div class="fn" />QPolygonF <b><a href="qgraphicsitem.html#mapFromItem-2">mapFromItem</a></b> (<i>self</i>, QGraphicsItem&#160;<i>item</i>, QRectF&#160;<i>rect</i>)</li><li><div class="fn" />QPolygonF <b><a href="qgraphicsitem.html#mapFromItem-3">mapFromItem</a></b> (<i>self</i>, QGraphicsItem&#160;<i>item</i>, QPolygonF&#160;<i>polygon</i>)</li><li><div class="fn" />QPainterPath <b><a href="qgraphicsitem.html#mapFromItem-4">mapFromItem</a></b> (<i>self</i>, QGraphicsItem&#160;<i>item</i>, QPainterPath&#160;<i>path</i>)</li><li><div class="fn" />QPointF <b><a href="qgraphicsitem.html#mapFromItem-5">mapFromItem</a></b> (<i>self</i>, QGraphicsItem&#160;<i>item</i>, float&#160;<i>ax</i>, float&#160;<i>ay</i>)</li><li><div class="fn" />QPolygonF <b><a href="qgraphicsitem.html#mapFromItem-6">mapFromItem</a></b> (<i>self</i>, QGraphicsItem&#160;<i>item</i>, float&#160;<i>ax</i>, float&#160;<i>ay</i>, float&#160;<i>w</i>, float&#160;<i>h</i>)</li><li><div class="fn" />QPointF <b><a href="qgraphicsitem.html#mapFromParent">mapFromParent</a></b> (<i>self</i>, QPointF&#160;<i>point</i>)</li><li><div class="fn" />QPolygonF <b><a href="qgraphicsitem.html#mapFromParent-2">mapFromParent</a></b> (<i>self</i>, QRectF&#160;<i>rect</i>)</li><li><div class="fn" />QPolygonF <b><a href="qgraphicsitem.html#mapFromParent-3">mapFromParent</a></b> (<i>self</i>, QPolygonF&#160;<i>polygon</i>)</li><li><div class="fn" />QPainterPath <b><a href="qgraphicsitem.html#mapFromParent-4">mapFromParent</a></b> (<i>self</i>, QPainterPath&#160;<i>path</i>)</li><li><div class="fn" />QPointF <b><a href="qgraphicsitem.html#mapFromParent-5">mapFromParent</a></b> (<i>self</i>, float&#160;<i>ax</i>, float&#160;<i>ay</i>)</li><li><div class="fn" />QPolygonF <b><a href="qgraphicsitem.html#mapFromParent-6">mapFromParent</a></b> (<i>self</i>, float&#160;<i>ax</i>, float&#160;<i>ay</i>, float&#160;<i>w</i>, float&#160;<i>h</i>)</li><li><div class="fn" />QPointF <b><a href="qgraphicsitem.html#mapFromScene">mapFromScene</a></b> (<i>self</i>, QPointF&#160;<i>point</i>)</li><li><div class="fn" />QPolygonF <b><a href="qgraphicsitem.html#mapFromScene-2">mapFromScene</a></b> (<i>self</i>, QRectF&#160;<i>rect</i>)</li><li><div class="fn" />QPolygonF <b><a href="qgraphicsitem.html#mapFromScene-3">mapFromScene</a></b> (<i>self</i>, QPolygonF&#160;<i>polygon</i>)</li><li><div class="fn" />QPainterPath <b><a href="qgraphicsitem.html#mapFromScene-4">mapFromScene</a></b> (<i>self</i>, QPainterPath&#160;<i>path</i>)</li><li><div class="fn" />QPointF <b><a href="qgraphicsitem.html#mapFromScene-5">mapFromScene</a></b> (<i>self</i>, float&#160;<i>ax</i>, float&#160;<i>ay</i>)</li><li><div class="fn" />QPolygonF <b><a href="qgraphicsitem.html#mapFromScene-6">mapFromScene</a></b> (<i>self</i>, float&#160;<i>ax</i>, float&#160;<i>ay</i>, float&#160;<i>w</i>, float&#160;<i>h</i>)</li><li><div class="fn" />QRectF <b><a href="qgraphicsitem.html#mapRectFromItem">mapRectFromItem</a></b> (<i>self</i>, QGraphicsItem&#160;<i>item</i>, QRectF&#160;<i>rect</i>)</li><li><div class="fn" />QRectF <b><a href="qgraphicsitem.html#mapRectFromItem-2">mapRectFromItem</a></b> (<i>self</i>, QGraphicsItem&#160;<i>item</i>, float&#160;<i>ax</i>, float&#160;<i>ay</i>, float&#160;<i>w</i>, float&#160;<i>h</i>)</li><li><div class="fn" />QRectF <b><a href="qgraphicsitem.html#mapRectFromParent">mapRectFromParent</a></b> (<i>self</i>, QRectF&#160;<i>rect</i>)</li><li><div class="fn" />QRectF <b><a href="qgraphicsitem.html#mapRectFromParent-2">mapRectFromParent</a></b> (<i>self</i>, float&#160;<i>ax</i>, float&#160;<i>ay</i>, float&#160;<i>w</i>, float&#160;<i>h</i>)</li><li><div class="fn" />QRectF <b><a href="qgraphicsitem.html#mapRectFromScene">mapRectFromScene</a></b> (<i>self</i>, QRectF&#160;<i>rect</i>)</li><li><div class="fn" />QRectF <b><a href="qgraphicsitem.html#mapRectFromScene-2">mapRectFromScene</a></b> (<i>self</i>, float&#160;<i>ax</i>, float&#160;<i>ay</i>, float&#160;<i>w</i>, float&#160;<i>h</i>)</li><li><div class="fn" />QRectF <b><a href="qgraphicsitem.html#mapRectToItem">mapRectToItem</a></b> (<i>self</i>, QGraphicsItem&#160;<i>item</i>, QRectF&#160;<i>rect</i>)</li><li><div class="fn" />QRectF <b><a href="qgraphicsitem.html#mapRectToItem-2">mapRectToItem</a></b> (<i>self</i>, QGraphicsItem&#160;<i>item</i>, float&#160;<i>ax</i>, float&#160;<i>ay</i>, float&#160;<i>w</i>, float&#160;<i>h</i>)</li><li><div class="fn" />QRectF <b><a href="qgraphicsitem.html#mapRectToParent">mapRectToParent</a></b> (<i>self</i>, QRectF&#160;<i>rect</i>)</li><li><div class="fn" />QRectF <b><a href="qgraphicsitem.html#mapRectToParent-2">mapRectToParent</a></b> (<i>self</i>, float&#160;<i>ax</i>, float&#160;<i>ay</i>, float&#160;<i>w</i>, float&#160;<i>h</i>)</li><li><div class="fn" />QRectF <b><a href="qgraphicsitem.html#mapRectToScene">mapRectToScene</a></b> (<i>self</i>, QRectF&#160;<i>rect</i>)</li><li><div class="fn" />QRectF <b><a href="qgraphicsitem.html#mapRectToScene-2">mapRectToScene</a></b> (<i>self</i>, float&#160;<i>ax</i>, float&#160;<i>ay</i>, float&#160;<i>w</i>, float&#160;<i>h</i>)</li><li><div class="fn" />QPointF <b><a href="qgraphicsitem.html#mapToItem">mapToItem</a></b> (<i>self</i>, QGraphicsItem&#160;<i>item</i>, QPointF&#160;<i>point</i>)</li><li><div class="fn" />QPolygonF <b><a href="qgraphicsitem.html#mapToItem-2">mapToItem</a></b> (<i>self</i>, QGraphicsItem&#160;<i>item</i>, QRectF&#160;<i>rect</i>)</li><li><div class="fn" />QPolygonF <b><a href="qgraphicsitem.html#mapToItem-3">mapToItem</a></b> (<i>self</i>, QGraphicsItem&#160;<i>item</i>, QPolygonF&#160;<i>polygon</i>)</li><li><div class="fn" />QPainterPath <b><a href="qgraphicsitem.html#mapToItem-4">mapToItem</a></b> (<i>self</i>, QGraphicsItem&#160;<i>item</i>, QPainterPath&#160;<i>path</i>)</li><li><div class="fn" />QPointF <b><a href="qgraphicsitem.html#mapToItem-5">mapToItem</a></b> (<i>self</i>, QGraphicsItem&#160;<i>item</i>, float&#160;<i>ax</i>, float&#160;<i>ay</i>)</li><li><div class="fn" />QPolygonF <b><a href="qgraphicsitem.html#mapToItem-6">mapToItem</a></b> (<i>self</i>, QGraphicsItem&#160;<i>item</i>, float&#160;<i>ax</i>, float&#160;<i>ay</i>, float&#160;<i>w</i>, float&#160;<i>h</i>)</li><li><div class="fn" />QPointF <b><a href="qgraphicsitem.html#mapToParent">mapToParent</a></b> (<i>self</i>, QPointF&#160;<i>point</i>)</li><li><div class="fn" />QPolygonF <b><a href="qgraphicsitem.html#mapToParent-2">mapToParent</a></b> (<i>self</i>, QRectF&#160;<i>rect</i>)</li><li><div class="fn" />QPolygonF <b><a href="qgraphicsitem.html#mapToParent-3">mapToParent</a></b> (<i>self</i>, QPolygonF&#160;<i>polygon</i>)</li><li><div class="fn" />QPainterPath <b><a href="qgraphicsitem.html#mapToParent-4">mapToParent</a></b> (<i>self</i>, QPainterPath&#160;<i>path</i>)</li><li><div class="fn" />QPointF <b><a href="qgraphicsitem.html#mapToParent-5">mapToParent</a></b> (<i>self</i>, float&#160;<i>ax</i>, float&#160;<i>ay</i>)</li><li><div class="fn" />QPolygonF <b><a href="qgraphicsitem.html#mapToParent-6">mapToParent</a></b> (<i>self</i>, float&#160;<i>ax</i>, float&#160;<i>ay</i>, float&#160;<i>w</i>, float&#160;<i>h</i>)</li><li><div class="fn" />QPointF <b><a href="qgraphicsitem.html#mapToScene">mapToScene</a></b> (<i>self</i>, QPointF&#160;<i>point</i>)</li><li><div class="fn" />QPolygonF <b><a href="qgraphicsitem.html#mapToScene-2">mapToScene</a></b> (<i>self</i>, QRectF&#160;<i>rect</i>)</li><li><div class="fn" />QPolygonF <b><a href="qgraphicsitem.html#mapToScene-3">mapToScene</a></b> (<i>self</i>, QPolygonF&#160;<i>polygon</i>)</li><li><div class="fn" />QPainterPath <b><a href="qgraphicsitem.html#mapToScene-4">mapToScene</a></b> (<i>self</i>, QPainterPath&#160;<i>path</i>)</li><li><div class="fn" />QPointF <b><a href="qgraphicsitem.html#mapToScene-5">mapToScene</a></b> (<i>self</i>, float&#160;<i>ax</i>, float&#160;<i>ay</i>)</li><li><div class="fn" />QPolygonF <b><a href="qgraphicsitem.html#mapToScene-6">mapToScene</a></b> (<i>self</i>, float&#160;<i>ax</i>, float&#160;<i>ay</i>, float&#160;<i>w</i>, float&#160;<i>h</i>)</li><li><div class="fn" />QMatrix <b><a href="qgraphicsitem.html#matrix">matrix</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#mouseDoubleClickEvent">mouseDoubleClickEvent</a></b> (<i>self</i>, QGraphicsSceneMouseEvent&#160;<i>event</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#mouseMoveEvent">mouseMoveEvent</a></b> (<i>self</i>, QGraphicsSceneMouseEvent&#160;<i>event</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#mousePressEvent">mousePressEvent</a></b> (<i>self</i>, QGraphicsSceneMouseEvent&#160;<i>event</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#mouseReleaseEvent">mouseReleaseEvent</a></b> (<i>self</i>, QGraphicsSceneMouseEvent&#160;<i>event</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#moveBy">moveBy</a></b> (<i>self</i>, float&#160;<i>dx</i>, float&#160;<i>dy</i>)</li><li><div class="fn" />float <b><a href="qgraphicsitem.html#opacity">opacity</a></b> (<i>self</i>)</li><li><div class="fn" />QPainterPath <b><a href="qgraphicsitem.html#opaqueArea">opaqueArea</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#paint">paint</a></b> (<i>self</i>, QPainter&#160;<i>painter</i>, QStyleOptionGraphicsItem&#160;<i>option</i>, QWidget&#160;<i>widget</i>&#160;=&#160;None)</li><li><div class="fn" />QGraphicsItem <b><a href="qgraphicsitem.html#panel">panel</a></b> (<i>self</i>)</li><li><div class="fn" />PanelModality <b><a href="qgraphicsitem.html#panelModality">panelModality</a></b> (<i>self</i>)</li><li><div class="fn" />QGraphicsItem <b><a href="qgraphicsitem.html#parentItem">parentItem</a></b> (<i>self</i>)</li><li><div class="fn" />QGraphicsObject <b><a href="qgraphicsitem.html#parentObject">parentObject</a></b> (<i>self</i>)</li><li><div class="fn" />QGraphicsWidget <b><a href="qgraphicsitem.html#parentWidget">parentWidget</a></b> (<i>self</i>)</li><li><div class="fn" />QPointF <b><a href="qgraphicsitem.html#pos">pos</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#prepareGeometryChange">prepareGeometryChange</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#removeSceneEventFilter">removeSceneEventFilter</a></b> (<i>self</i>, QGraphicsItem&#160;<i>filterItem</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#resetMatrix">resetMatrix</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#resetTransform">resetTransform</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#rotate">rotate</a></b> (<i>self</i>, float&#160;<i>angle</i>)</li><li><div class="fn" />float <b><a href="qgraphicsitem.html#rotation">rotation</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#scale">scale</a></b> (<i>self</i>, float&#160;<i>sx</i>, float&#160;<i>sy</i>)</li><li><div class="fn" />float <b><a href="qgraphicsitem.html#scale-2">scale</a></b> (<i>self</i>)</li><li><div class="fn" />QGraphicsScene <b><a href="qgraphicsitem.html#scene">scene</a></b> (<i>self</i>)</li><li><div class="fn" />QRectF <b><a href="qgraphicsitem.html#sceneBoundingRect">sceneBoundingRect</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qgraphicsitem.html#sceneEvent">sceneEvent</a></b> (<i>self</i>, QEvent&#160;<i>event</i>)</li><li><div class="fn" />bool <b><a href="qgraphicsitem.html#sceneEventFilter">sceneEventFilter</a></b> (<i>self</i>, QGraphicsItem&#160;<i>watched</i>, QEvent&#160;<i>event</i>)</li><li><div class="fn" />QMatrix <b><a href="qgraphicsitem.html#sceneMatrix">sceneMatrix</a></b> (<i>self</i>)</li><li><div class="fn" />QPointF <b><a href="qgraphicsitem.html#scenePos">scenePos</a></b> (<i>self</i>)</li><li><div class="fn" />QTransform <b><a href="qgraphicsitem.html#sceneTransform">sceneTransform</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#scroll">scroll</a></b> (<i>self</i>, float&#160;<i>dx</i>, float&#160;<i>dy</i>, QRectF&#160;<i>rect</i>&#160;=&#160;QRectF())</li><li><div class="fn" /><b><a href="qgraphicsitem.html#setAcceptDrops">setAcceptDrops</a></b> (<i>self</i>, bool&#160;<i>on</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#setAcceptedMouseButtons">setAcceptedMouseButtons</a></b> (<i>self</i>, Qt.MouseButtons&#160;<i>buttons</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#setAcceptHoverEvents">setAcceptHoverEvents</a></b> (<i>self</i>, bool&#160;<i>enabled</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#setAcceptsHoverEvents">setAcceptsHoverEvents</a></b> (<i>self</i>, bool&#160;<i>enabled</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#setAcceptTouchEvents">setAcceptTouchEvents</a></b> (<i>self</i>, bool&#160;<i>enabled</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#setActive">setActive</a></b> (<i>self</i>, bool&#160;<i>active</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#setBoundingRegionGranularity">setBoundingRegionGranularity</a></b> (<i>self</i>, float&#160;<i>granularity</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#setCacheMode">setCacheMode</a></b> (<i>self</i>, CacheMode&#160;<i>mode</i>, QSize&#160;<i>logicalCacheSize</i>&#160;=&#160;QSize())</li><li><div class="fn" /><b><a href="qgraphicsitem.html#setCursor">setCursor</a></b> (<i>self</i>, QCursor&#160;<i>cursor</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#setData">setData</a></b> (<i>self</i>, int&#160;<i>key</i>, QVariant&#160;<i>value</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#setEnabled">setEnabled</a></b> (<i>self</i>, bool&#160;<i>enabled</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#setFiltersChildEvents">setFiltersChildEvents</a></b> (<i>self</i>, bool&#160;<i>enabled</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#setFlag">setFlag</a></b> (<i>self</i>, GraphicsItemFlag&#160;<i>flag</i>, bool&#160;<i>enabled</i>&#160;=&#160;True)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#setFlags">setFlags</a></b> (<i>self</i>, GraphicsItemFlags&#160;<i>flags</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#setFocus">setFocus</a></b> (<i>self</i>, Qt.FocusReason&#160;<i>focusReason</i>&#160;=&#160;Qt.OtherFocusReason)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#setFocusProxy">setFocusProxy</a></b> (<i>self</i>, QGraphicsItem&#160;<i>item</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#setGraphicsEffect">setGraphicsEffect</a></b> (<i>self</i>, QGraphicsEffect&#160;<i>effect</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#setGroup">setGroup</a></b> (<i>self</i>, QGraphicsItemGroup&#160;<i>group</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#setHandlesChildEvents">setHandlesChildEvents</a></b> (<i>self</i>, bool&#160;<i>enabled</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#setInputMethodHints">setInputMethodHints</a></b> (<i>self</i>, Qt.InputMethodHints&#160;<i>hints</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#setMatrix">setMatrix</a></b> (<i>self</i>, QMatrix&#160;<i>matrix</i>, bool&#160;<i>combine</i>&#160;=&#160;False)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#setOpacity">setOpacity</a></b> (<i>self</i>, float&#160;<i>opacity</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#setPanelModality">setPanelModality</a></b> (<i>self</i>, PanelModality&#160;<i>panelModality</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#setParentItem">setParentItem</a></b> (<i>self</i>, QGraphicsItem&#160;<i>parent</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#setPos">setPos</a></b> (<i>self</i>, QPointF&#160;<i>pos</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#setPos-2">setPos</a></b> (<i>self</i>, float&#160;<i>ax</i>, float&#160;<i>ay</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#setRotation">setRotation</a></b> (<i>self</i>, float&#160;<i>angle</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#setScale">setScale</a></b> (<i>self</i>, float&#160;<i>scale</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#setSelected">setSelected</a></b> (<i>self</i>, bool&#160;<i>selected</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#setToolTip">setToolTip</a></b> (<i>self</i>, QString&#160;<i>toolTip</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#setTransform">setTransform</a></b> (<i>self</i>, QTransform&#160;<i>matrix</i>, bool&#160;<i>combine</i>&#160;=&#160;False)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#setTransformations">setTransformations</a></b> (<i>self</i>, list-of-QGraphicsTransform&#160;<i>transformations</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#setTransformOriginPoint">setTransformOriginPoint</a></b> (<i>self</i>, QPointF&#160;<i>origin</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#setTransformOriginPoint-2">setTransformOriginPoint</a></b> (<i>self</i>, float&#160;<i>ax</i>, float&#160;<i>ay</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#setVisible">setVisible</a></b> (<i>self</i>, bool&#160;<i>visible</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#setX">setX</a></b> (<i>self</i>, float&#160;<i>x</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#setY">setY</a></b> (<i>self</i>, float&#160;<i>y</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#setZValue">setZValue</a></b> (<i>self</i>, float&#160;<i>z</i>)</li><li><div class="fn" />QPainterPath <b><a href="qgraphicsitem.html#shape">shape</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#shear">shear</a></b> (<i>self</i>, float&#160;<i>sh</i>, float&#160;<i>sv</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#show">show</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#stackBefore">stackBefore</a></b> (<i>self</i>, QGraphicsItem&#160;<i>sibling</i>)</li><li><div class="fn" />QGraphicsObject <b><a href="qgraphicsitem.html#toGraphicsObject">toGraphicsObject</a></b> (<i>self</i>)</li><li><div class="fn" />QString <b><a href="qgraphicsitem.html#toolTip">toolTip</a></b> (<i>self</i>)</li><li><div class="fn" />QGraphicsItem <b><a href="qgraphicsitem.html#topLevelItem">topLevelItem</a></b> (<i>self</i>)</li><li><div class="fn" />QGraphicsWidget <b><a href="qgraphicsitem.html#topLevelWidget">topLevelWidget</a></b> (<i>self</i>)</li><li><div class="fn" />QTransform <b><a href="qgraphicsitem.html#transform">transform</a></b> (<i>self</i>)</li><li><div class="fn" />list-of-QGraphicsTransform <b><a href="qgraphicsitem.html#transformations">transformations</a></b> (<i>self</i>)</li><li><div class="fn" />QPointF <b><a href="qgraphicsitem.html#transformOriginPoint">transformOriginPoint</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#translate">translate</a></b> (<i>self</i>, float&#160;<i>dx</i>, float&#160;<i>dy</i>)</li><li><div class="fn" />int <b><a href="qgraphicsitem.html#type">type</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#ungrabKeyboard">ungrabKeyboard</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#ungrabMouse">ungrabMouse</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#unsetCursor">unsetCursor</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#update">update</a></b> (<i>self</i>, QRectF&#160;<i>rect</i>&#160;=&#160;QRectF())</li><li><div class="fn" /><b><a href="qgraphicsitem.html#update-2">update</a></b> (<i>self</i>, float&#160;<i>ax</i>, float&#160;<i>ay</i>, float&#160;<i>width</i>, float&#160;<i>height</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#updateMicroFocus">updateMicroFocus</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qgraphicsitem.html#wheelEvent">wheelEvent</a></b> (<i>self</i>, QGraphicsSceneWheelEvent&#160;<i>event</i>)</li><li><div class="fn" />QGraphicsWidget <b><a href="qgraphicsitem.html#window">window</a></b> (<i>self</i>)</li><li><div class="fn" />float <b><a href="qgraphicsitem.html#x">x</a></b> (<i>self</i>)</li><li><div class="fn" />float <b><a href="qgraphicsitem.html#y">y</a></b> (<i>self</i>)</li><li><div class="fn" />float <b><a href="qgraphicsitem.html#zValue">zValue</a></b> (<i>self</i>)</li></ul><h3>Static Members</h3><ul><li><div class="fn" />int <b><a href="qgraphicsitem.html#UserType-var">UserType</a></b></li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QGraphicsItem class is the base class for all graphical
items in a <a href="qgraphicsscene.html">QGraphicsScene</a>.</p>
<p>It provides a light-weight foundation for writing your own
custom items. This includes defining the item's geometry, collision
detection, its painting implementation and item interaction through
its event handlers. QGraphicsItem is part of the <a href="graphicsview.html">Graphics View Framework</a></p>
<p class="centerAlign"><img src="images/graphicsview-items.png" /></p>
<p>For convenience, Qt provides a set of standard graphics items
for the most common shapes. These are:</p>
<ul>
<li><a href="qgraphicsellipseitem.html">QGraphicsEllipseItem</a>
provides an ellipse item</li>
<li><a href="qgraphicslineitem.html">QGraphicsLineItem</a> provides
a line item</li>
<li><a href="qgraphicspathitem.html">QGraphicsPathItem</a> provides
an arbitrary path item</li>
<li><a href="qgraphicspixmapitem.html">QGraphicsPixmapItem</a>
provides a pixmap item</li>
<li><a href="qgraphicspolygonitem.html">QGraphicsPolygonItem</a>
provides a polygon item</li>
<li><a href="qgraphicsrectitem.html">QGraphicsRectItem</a> provides
a rectangular item</li>
<li><a href="qgraphicssimpletextitem.html">QGraphicsSimpleTextItem</a> provides
a simple text label item</li>
<li><a href="qgraphicstextitem.html">QGraphicsTextItem</a> provides
an advanced text browser item</li>
</ul>
<p>All of an item's geometric information is based on its local
coordinate system. The item's position, <a href="qgraphicsitem.html#pos">pos</a>(), is the only function that does
not operate in local coordinates, as it returns a position in
parent coordinates. <a href="graphicsview.html#the-graphics-view-coordinate-system">The
Graphics View Coordinate System</a> describes the coordinate system
in detail.</p>
<p>You can set whether an item should be visible (i.e., drawn, and
accepting events), by calling <a href="qgraphicsitem.html#setVisible">setVisible</a>(). Hiding an item
will also hide its children. Similarly, you can enable or disable
an item by calling <a href="qgraphicsitem.html#setEnabled">setEnabled</a>(). If you disable an
item, all its children will also be disabled. By default, items are
both visible and enabled. To toggle whether an item is selected or
not, first enable selection by setting the <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemIsSelectable</a>
flag, and then call <a href="qgraphicsitem.html#setSelected">setSelected</a>(). Normally,
selection is toggled by the scene, as a result of user
interaction.</p>
<p>To write your own graphics item, you first create a subclass of
QGraphicsItem, and then start by implementing its two pure virtual
public functions: <a href="qgraphicsitem.html#boundingRect">boundingRect</a>(), which returns
an estimate of the area painted by the item, and <a href="qgraphicsitem.html#paint">paint</a>(), which implements the actual
painting. For example:</p>
<pre class="cpp">
 <span class="keyword">class</span> SimpleItem : <span class="keyword">public</span> <span class="type">QGraphicsItem</span>
 {
 <span class="keyword">public</span>:
     <span class="type"><a href="qrectf.html">QRectF</a></span> boundingRect() <span class="keyword">const</span>
     {
         <span class="type"><a href="qtcore.html#qreal-typedef">qreal</a></span> penWidth <span class="operator">=</span> <span class="number">1</span>;
         <span class="keyword">return</span> <span class="type"><a href="qrectf.html">QRectF</a></span>(<span class="operator">-</span><span class="number">10</span> <span class="operator">-</span> penWidth <span class="operator">/</span> <span class="number">2</span><span class="operator">,</span> <span class="operator">-</span><span class="number">10</span> <span class="operator">-</span> penWidth <span class="operator">/</span> <span class="number">2</span><span class="operator">,</span>
                       <span class="number">20</span> <span class="operator">+</span> penWidth<span class="operator">,</span> <span class="number">20</span> <span class="operator">+</span> penWidth);
     }

     <span class="type">void</span> paint(<span class="type"><a href="qpainter.html">QPainter</a></span> <span class="operator">*</span>painter<span class="operator">,</span> <span class="keyword">const</span> <span class="type"><a href="qstyleoptiongraphicsitem.html">QStyleOptionGraphicsItem</a></span> <span class="operator">*</span>option<span class="operator">,</span>
                <span class="type"><a href="qwidget.html">QWidget</a></span> <span class="operator">*</span>widget)
     {
         painter<span class="operator">-</span><span class="operator">&gt;</span>drawRoundedRect(<span class="operator">-</span><span class="number">10</span><span class="operator">,</span> <span class="operator">-</span><span class="number">10</span><span class="operator">,</span> <span class="number">20</span><span class="operator">,</span> <span class="number">20</span><span class="operator">,</span> <span class="number">5</span><span class="operator">,</span> <span class="number">5</span>);
     }
 };
</pre>
<p>The <a href="qgraphicsitem.html#boundingRect">boundingRect</a>()
function has many different purposes. <a href="qgraphicsscene.html">QGraphicsScene</a> bases its item index on
<a href="qgraphicsitem.html#boundingRect">boundingRect</a>(), and
<a href="qgraphicsview.html">QGraphicsView</a> uses it both for
culling invisible items, and for determining the area that needs to
be recomposed when drawing overlapping items. In addition,
QGraphicsItem's collision detection mechanisms use <a href="qgraphicsitem.html#boundingRect">boundingRect</a>() to provide an
efficient cut-off. The fine grained collision algorithm in <a href="qgraphicsitem.html#collidesWithItem">collidesWithItem</a>() is
based on calling <a href="qgraphicsitem.html#shape">shape</a>(),
which returns an accurate outline of the item's shape as a <a href="qpainterpath.html">QPainterPath</a>.</p>
<p><a href="qgraphicsscene.html">QGraphicsScene</a> expects all
items <a href="qgraphicsitem.html#boundingRect">boundingRect</a>()
and <a href="qgraphicsitem.html#shape">shape</a>() to remain
unchanged unless it is notified. If you want to change an item's
geometry in any way, you must first call <a href="qgraphicsitem.html#prepareGeometryChange">prepareGeometryChange</a>()
to allow <a href="qgraphicsscene.html">QGraphicsScene</a> to update
its bookkeeping.</p>
<p>Collision detection can be done in two ways:</p>
<ol class="1">
<li>Reimplement <a href="qgraphicsitem.html#shape">shape</a>() to
return an accurate shape for your item, and rely on the default
implementation of <a href="qgraphicsitem.html#collidesWithItem">collidesWithItem</a>() to do
shape-shape intersection. This can be rather expensive if the
shapes are complex.</li>
<li>Reimplement <a href="qgraphicsitem.html#collidesWithItem">collidesWithItem</a>() to
provide your own custom item and shape collision algorithm.</li>
</ol>
<p>The <a href="qgraphicsitem.html#contains">contains</a>()
function can be called to determine whether the item
<i>contains</i> a point or not. This function can also be
reimplemented by the item. The default behavior of <a href="qgraphicsitem.html#contains">contains</a>() is based on calling
<a href="qgraphicsitem.html#shape">shape</a>().</p>
<p>Items can contain other items, and also be contained by other
items. All items can have a parent item and a list of children.
Unless the item has no parent, its position is in <i>parent</i>
coordinates (i.e., the parent's local coordinates). Parent items
propagate both their position and their transformation to all
children.</p>
<p class="centerAlign"><img src="images/graphicsview-parentchild.png" /></p>
<a id="transformations" name="transformations" /><a id="transformations" name="transformations" />
<h3>Transformations</h3>
<p>QGraphicsItem supports projective transformations in addition to
its base position, <a href="qgraphicsitem.html#pos">pos</a>().
There are several ways to change an item's transformation. For
simple transformations, you can call either of the convenience
functions <a href="qgraphicsitem.html#setRotation">setRotation</a>() or <a href="qgraphicsitem.html#setScale">setScale</a>(), or you can pass any
transformation matrix to <a href="qgraphicsitem.html#setTransform">setTransform</a>(). For advanced
transformation control you also have the option of setting several
combined transformations by calling <a href="qgraphicsitem.html#setTransformations">setTransformations</a>().</p>
<p>Item transformations accumulate from parent to child, so if both
a parent and child item are rotated 90 degrees, the child's total
transformation will be 180 degrees. Similarly, if the item's parent
is scaled to 2x its original size, its children will also be twice
as large. An item's transformation does not affect its own local
geometry; all geometry functions (e.g., <a href="qgraphicsitem.html#contains">contains</a>(), <a href="qgraphicsitem.html#update">update</a>(), and all the mapping
functions) still operate in local coordinates. For convenience,
QGraphicsItem provides the functions <a href="qgraphicsitem.html#sceneTransform">sceneTransform</a>(), which
returns the item's total transformation matrix (including its
position and all parents' positions and transformations), and
<a href="qgraphicsitem.html#scenePos">scenePos</a>(), which returns
its position in scene coordinates. To reset an item's matrix, call
<a href="qgraphicsitem.html#resetTransform">resetTransform</a>().</p>
<p>Certain transformation operations produce a different outcome
depending on the order in which they are applied. For example, if
you scale an transform, and then rotate it, you may get a different
result than if the transform was rotated first. However, the order
you set the transformation properties on QGraphicsItem does not
affect the resulting transformation; QGraphicsItem always applies
the properties in a fixed, defined order:</p>
<ul>
<li>The item's base transform is applied (<a href="qgraphicsitem.html#transform">transform</a>())</li>
<li>The item's transformations list is applied in order (<a href="qgraphicsitem.html#transformations">transformations</a>())</li>
<li>The item is rotated relative to its transform origin point
(<a href="qgraphicsitem.html#rotation">rotation</a>(), <a href="qgraphicsitem.html#transformOriginPoint">transformOriginPoint</a>())</li>
<li>The item is scaled relative to its transform origin point
(<a href="qgraphicsitem.html#scale">scale</a>(), <a href="qgraphicsitem.html#transformOriginPoint">transformOriginPoint</a>())</li>
</ul>
<a id="painting" name="painting" />
<h3>Painting</h3>
<p>The <a href="qgraphicsitem.html#paint">paint</a>() function is
called by <a href="qgraphicsview.html">QGraphicsView</a> to paint
the item's contents. The item has no background or default fill of
its own; whatever is behind the item will shine through all areas
that are not explicitly painted in this function. You can call
<a href="qgraphicsitem.html#update">update</a>() to schedule a
repaint, optionally passing the rectangle that needs a repaint.
Depending on whether or not the item is visible in a view, the item
may or may not be repainted; there is no equivalent to <a href="qwidget.html#repaint">QWidget.repaint</a>() in QGraphicsItem.</p>
<p>Items are painted by the view, starting with the parent items
and then drawing children, in ascending stacking order. You can set
an item's stacking order by calling <a href="qgraphicsitem.html#setZValue">setZValue</a>(), and test it by
calling <a href="qgraphicsitem.html#zValue">zValue</a>(), where
items with low z-values are painted before items with high
z-values. Stacking order applies to sibling items; parents are
always drawn before their children.</p>
<a id="sorting" name="sorting" />
<h3>Sorting</h3>
<p>All items are drawn in a defined, stable order, and this same
order decides which items will receive mouse input first when you
click on the scene. Normally you don't have to worry about sorting,
as the items follow a "natural order", following the logical
structure of the scene.</p>
<p>An item's children are stacked on top of the parent, and sibling
items are stacked by insertion order (i.e., in the same order that
they were either added to the scene, or added to the same parent).
If you add item A, and then B, then B will be on top of A. If you
then add C, the items' stacking order will be A, then B, then
C.</p>
<p class="centerAlign"><img src="images/graphicsview-zorder.png" /></p>
<p>This example shows the stacking order of all limbs of the robot
from the <a href="graphicsview-dragdroprobot.html">Drag and Drop
Robot</a> example. The torso is the root item (all other items are
children or descendants of the torso), so it is drawn first. Next,
the head is drawn, as it is the first item in the torso's list of
children. Then the upper left arm is drawn. As the lower arm is a
child of the upper arm, the lower arm is then drawn, followed by
the upper arm's next sibling, which is the upper right arm, and so
on.</p>
<p>For advanced users, there are ways to alter how your items are
sorted:</p>
<ul>
<li>You can call <a href="qgraphicsitem.html#setZValue">setZValue</a>() on an item to
explicitly stack it on top of, or under, other sibling items. The
default Z value for an item is 0. Items with the same Z value are
stacked by insertion order.</li>
<li>You can call <a href="qgraphicsitem.html#stackBefore">stackBefore</a>() to reorder the
list of children. This will directly modify the insertion
order.</li>
<li>You can set the <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemStacksBehindParent</a>
flag to stack a child item behind its parent.</li>
</ul>
<p>The stacking order of two sibling items also counts for each
item's children and descendant items. So if one item is on top of
another, then all its children will also be on top of all the other
item's children as well.</p>
<a id="events" name="events" />
<h3>Events</h3>
<p>QGraphicsItem receives events from <a href="qgraphicsscene.html">QGraphicsScene</a> through the virtual
function <a href="qgraphicsitem.html#sceneEvent">sceneEvent</a>().
This function distributes the most common events to a set of
convenience event handlers:</p>
<ul>
<li><a href="qgraphicsitem.html#contextMenuEvent">contextMenuEvent</a>()
handles context menu events</li>
<li><a href="qgraphicsitem.html#focusInEvent">focusInEvent</a>()
and <a href="qgraphicsitem.html#focusOutEvent">focusOutEvent</a>()
handle focus in and out events</li>
<li><a href="qgraphicsitem.html#hoverEnterEvent">hoverEnterEvent</a>(),
<a href="qgraphicsitem.html#hoverMoveEvent">hoverMoveEvent</a>(),
and <a href="qgraphicsitem.html#hoverLeaveEvent">hoverLeaveEvent</a>() handles
hover enter, move and leave events</li>
<li><a href="qgraphicsitem.html#inputMethodEvent">inputMethodEvent</a>()
handles input events, for accessibility support</li>
<li><a href="qgraphicsitem.html#keyPressEvent">keyPressEvent</a>()
and <a href="qgraphicsitem.html#keyReleaseEvent">keyReleaseEvent</a>() handle
key press and release events</li>
<li><a href="qgraphicsitem.html#mousePressEvent">mousePressEvent</a>(),
<a href="qgraphicsitem.html#mouseMoveEvent">mouseMoveEvent</a>(),
<a href="qgraphicsitem.html#mouseReleaseEvent">mouseReleaseEvent</a>(), and
<a href="qgraphicsitem.html#mouseDoubleClickEvent">mouseDoubleClickEvent</a>()
handles mouse press, move, release, click and doubleclick
events</li>
</ul>
<p>You can filter events for any other item by installing event
filters. This functionality is separate from Qt's regular event
filters (see <a href="qobject.html#installEventFilter">QObject.installEventFilter</a>()),
which only work on subclasses of <a href="qobject.html">QObject</a>. After installing your item as an event
filter for another item by calling <a href="qgraphicsitem.html#installSceneEventFilter">installSceneEventFilter</a>(),
the filtered events will be received by the virtual function
<a href="qgraphicsitem.html#sceneEventFilter">sceneEventFilter</a>(). You
can remove item event filters by calling <a href="qgraphicsitem.html#removeSceneEventFilter">removeSceneEventFilter</a>().</p>
<a id="custom-data" name="custom-data" />
<h3>Custom Data</h3>
<p>Sometimes it's useful to register custom data with an item, be
it a custom item, or a standard item. You can call <a href="qgraphicsitem.html#setData">setData</a>() on any item to store
data in it using a key-value pair (the key being an integer, and
the value is a <a href="qvariant.html">QVariant</a>). To get custom
data from an item, call <a href="qgraphicsitem.html#data">data</a>(). This functionality is
completely untouched by Qt itself; it is provided for the user's
convenience.</p>
<hr /><h2>Type Documentation</h2><h3 class="fn"><a name="CacheMode-enum" />QGraphicsItem.CacheMode</h3><p>This enum describes <a href="qgraphicsitem.html">QGraphicsItem</a>'s cache modes. Caching is
used to speed up rendering by allocating and rendering to an
off-screen pixel buffer, which can be reused when the item requires
redrawing. For some paint devices, the cache is stored directly in
graphics memory, which makes rendering very quick.</p>
<table class="valuelist">
<tr class="odd" valign="top">
<th class="tblConst">Constant</th>
<th class="tblval">Value</th>
<th class="tbldscr">Description</th>
</tr>
<tr>
<td class="topAlign"><tt>QGraphicsItem.NoCache</tt></td>
<td class="topAlign"><tt>0</tt></td>
<td class="topAlign">The default; all item caching is disabled.
<a href="qgraphicsitem.html#paint">QGraphicsItem.paint</a>() is
called every time the item needs redrawing.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QGraphicsItem.ItemCoordinateCache</tt></td>
<td class="topAlign"><tt>1</tt></td>
<td class="topAlign">Caching is enabled for the item's logical
(local) coordinate system. <a href="qgraphicsitem.html">QGraphicsItem</a> creates an off-screen pixel
buffer with a configurable size / resolution that you can pass to
<a href="qgraphicsitem.html#setCacheMode">QGraphicsItem.setCacheMode</a>().
Rendering quality will typically degrade, depending on the
resolution of the cache and the item transformation. The first time
the item is redrawn, it will render itself into the cache, and the
cache is then reused for every subsequent expose. The cache is also
reused as the item is transformed. To adjust the resolution of the
cache, you can call <a href="qgraphicsitem.html#setCacheMode">setCacheMode</a>() again.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QGraphicsItem.DeviceCoordinateCache</tt></td>
<td class="topAlign"><tt>2</tt></td>
<td class="topAlign">Caching is enabled at the paint device level,
in device coordinates. This mode is for items that can move, but
are not rotated, scaled or sheared. If the item is transformed
directly or indirectly, the cache will be regenerated
automatically. Unlike ItemCoordinateCacheMode,
DeviceCoordinateCache always renders at maximum quality.</td>
</tr>
</table>
<p>This enum was introduced or modified in Qt 4.4.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#setCacheMode">QGraphicsItem.setCacheMode</a>().</p>


<h3 class="fn"><a name="GraphicsItemChange-enum" />QGraphicsItem.GraphicsItemChange</h3><p>This enum describes the state changes that are notified by
<a href="qgraphicsitem.html#itemChange">QGraphicsItem.itemChange</a>().
The notifications are sent as the state changes, and in some cases,
adjustments can be made (see the documentation for each change for
details).</p>
<p>Note: Be careful with calling functions on the <a href="qgraphicsitem.html">QGraphicsItem</a> itself inside <a href="qgraphicsitem.html#itemChange">itemChange</a>(), as certain
function calls can lead to unwanted recursion. For example, you
cannot call <a href="qgraphicsitem.html#setPos">setPos</a>() in
<a href="qgraphicsitem.html#itemChange">itemChange</a>() on an
ItemPositionChange notification, as the <a href="qgraphicsitem.html#setPos">setPos</a>() function will again call
itemChange(ItemPositionChange). Instead, you can return the new,
adjusted position from <a href="qgraphicsitem.html#itemChange">itemChange</a>().</p>
<table class="valuelist">
<tr class="odd" valign="top">
<th class="tblConst">Constant</th>
<th class="tblval">Value</th>
<th class="tbldscr">Description</th>
</tr>
<tr>
<td class="topAlign"><tt>QGraphicsItem.ItemEnabledChange</tt></td>
<td class="topAlign"><tt>3</tt></td>
<td class="topAlign">The item's enabled state changes. If the item
is presently enabled, it will become disabled, and vice verca. The
value argument is the new enabled state (i.e., true or false). Do
not call <a href="qgraphicsitem.html#setEnabled">setEnabled</a>()
in <a href="qgraphicsitem.html#itemChange">itemChange</a>() as this
notification is delivered. Instead, you can return the new state
from <a href="qgraphicsitem.html#itemChange">itemChange</a>().</td>
</tr>
<tr>
<td class="topAlign">
<tt>QGraphicsItem.ItemEnabledHasChanged</tt></td>
<td class="topAlign"><tt>13</tt></td>
<td class="topAlign">The item's enabled state has changed. The
value argument is the new enabled state (i.e., true or false). Do
not call <a href="qgraphicsitem.html#setEnabled">setEnabled</a>()
in <a href="qgraphicsitem.html#itemChange">itemChange</a>() as this
notification is delivered. The return value is ignored.</td>
</tr>
<tr>
<td class="topAlign"><tt>QGraphicsItem.ItemMatrixChange</tt></td>
<td class="topAlign"><tt>1</tt></td>
<td class="topAlign">The item's affine transformation matrix is
changing. This value is obsolete; you can use ItemTransformChange
instead.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QGraphicsItem.ItemPositionChange</tt></td>
<td class="topAlign"><tt>0</tt></td>
<td class="topAlign">The item's position changes. This notification
is sent if the <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemSendsGeometryChanges</a>
flag is enabled, and when the item's local position changes,
relative to its parent (i.e., as a result of calling <a href="qgraphicsitem.html#setPos">setPos</a>() or <a href="qgraphicsitem.html#moveBy">moveBy</a>()). The value argument is
the new position (i.e., a <a href="qpointf.html">QPointF</a>). You
can call <a href="qgraphicsitem.html#pos">pos</a>() to get the
original position. Do not call <a href="qgraphicsitem.html#setPos">setPos</a>() or <a href="qgraphicsitem.html#moveBy">moveBy</a>() in <a href="qgraphicsitem.html#itemChange">itemChange</a>() as this
notification is delivered; instead, you can return the new,
adjusted position from <a href="qgraphicsitem.html#itemChange">itemChange</a>(). After this
notification, <a href="qgraphicsitem.html">QGraphicsItem</a>
immediately sends the ItemPositionHasChanged notification if the
position changed.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QGraphicsItem.ItemPositionHasChanged</tt></td>
<td class="topAlign"><tt>9</tt></td>
<td class="topAlign">The item's position has changed. This
notification is sent if the <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemSendsGeometryChanges</a>
flag is enabled, and after the item's local position, relative to
its parent, has changed. The value argument is the new position
(the same as <a href="qgraphicsitem.html#pos">pos</a>()), and
<a href="qgraphicsitem.html">QGraphicsItem</a> ignores the return
value for this notification (i.e., a read-only notification).</td>
</tr>
<tr>
<td class="topAlign">
<tt>QGraphicsItem.ItemTransformChange</tt></td>
<td class="topAlign"><tt>8</tt></td>
<td class="topAlign">The item's transformation matrix changes. This
notification is send if the <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemSendsGeometryChanges</a>
flag is enabled, and when the item's local transformation matrix
changes (i.e., as a result of calling <a href="qgraphicsitem.html#setTransform">setTransform</a>(). The value
argument is the new matrix (i.e., a <a href="qtransform.html">QTransform</a>); to get the old matrix, call
<a href="qgraphicsitem.html#transform">transform</a>(). Do not call
<a href="qgraphicsitem.html#setTransform">setTransform</a>() or set
any of the transformation properties in <a href="qgraphicsitem.html#itemChange">itemChange</a>() as this
notification is delivered; instead, you can return the new matrix
from <a href="qgraphicsitem.html#itemChange">itemChange</a>(). This
notification is not sent if you change the transformation
properties.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QGraphicsItem.ItemTransformHasChanged</tt></td>
<td class="topAlign"><tt>10</tt></td>
<td class="topAlign">The item's transformation matrix has changed
either because setTransform is called, or one of the transformation
properties is changed. This notification is sent if the <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemSendsGeometryChanges</a>
flag is enabled, and after the item's local transformation matrix
has changed. The value argument is the new matrix (same as <a href="qgraphicsitem.html#transform">transform</a>()), and <a href="qgraphicsitem.html">QGraphicsItem</a> ignores the return value for
this notification (i.e., a read-only notification).</td>
</tr>
<tr>
<td class="topAlign">
<tt>QGraphicsItem.ItemRotationChange</tt></td>
<td class="topAlign"><tt>28</tt></td>
<td class="topAlign">The item's rotation property changes. This
notification is sent if the <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemSendsGeometryChanges</a>
flag is enabled, and when the item's rotation property changes
(i.e., as a result of calling <a href="qgraphicsitem.html#setRotation">setRotation</a>()). The value
argument is the new rotation (i.e., a double); to get the old
rotation, call <a href="qgraphicsitem.html#rotation">rotation</a>(). Do not call <a href="qgraphicsitem.html#setRotation">setRotation</a>() in <a href="qgraphicsitem.html#itemChange">itemChange</a>() as this
notification is delivered; instead, you can return the new rotation
from <a href="qgraphicsitem.html#itemChange">itemChange</a>().</td>
</tr>
<tr>
<td class="topAlign">
<tt>QGraphicsItem.ItemRotationHasChanged</tt></td>
<td class="topAlign"><tt>29</tt></td>
<td class="topAlign">The item's rotation property has changed. This
notification is sent if the <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemSendsGeometryChanges</a>
flag is enabled, and after the item's rotation property has
changed. The value argument is the new rotation (i.e., a double),
and <a href="qgraphicsitem.html">QGraphicsItem</a> ignores the
return value for this notification (i.e., a read-only
notification). Do not call <a href="qgraphicsitem.html#setRotation">setRotation</a>() in <a href="qgraphicsitem.html#itemChange">itemChange</a>() as this
notification is delivered.</td>
</tr>
<tr>
<td class="topAlign"><tt>QGraphicsItem.ItemScaleChange</tt></td>
<td class="topAlign"><tt>30</tt></td>
<td class="topAlign">The item's scale property changes. This
notification is sent if the <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemSendsGeometryChanges</a>
flag is enabled, and when the item's scale property changes (i.e.,
as a result of calling <a href="qgraphicsitem.html#setScale">setScale</a>()). The value argument
is the new scale (i.e., a double); to get the old scale, call
<a href="qgraphicsitem.html#scale">scale</a>(). Do not call
<a href="qgraphicsitem.html#setScale">setScale</a>() in <a href="qgraphicsitem.html#itemChange">itemChange</a>() as this
notification is delivered; instead, you can return the new scale
from <a href="qgraphicsitem.html#itemChange">itemChange</a>().</td>
</tr>
<tr>
<td class="topAlign">
<tt>QGraphicsItem.ItemScaleHasChanged</tt></td>
<td class="topAlign"><tt>31</tt></td>
<td class="topAlign">The item's scale property has changed. This
notification is sent if the <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemSendsGeometryChanges</a>
flag is enabled, and after the item's scale property has changed.
The value argument is the new scale (i.e., a double), and <a href="qgraphicsitem.html">QGraphicsItem</a> ignores the return value for
this notification (i.e., a read-only notification). Do not call
<a href="qgraphicsitem.html#setScale">setScale</a>() in <a href="qgraphicsitem.html#itemChange">itemChange</a>() as this
notification is delivered.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QGraphicsItem.ItemTransformOriginPointChange</tt></td>
<td class="topAlign"><tt>32</tt></td>
<td class="topAlign">The item's transform origin point property
changes. This notification is sent if the <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemSendsGeometryChanges</a>
flag is enabled, and when the item's transform origin point
property changes (i.e., as a result of calling <a href="qgraphicsitem.html#setTransformOriginPoint">setTransformOriginPoint</a>()).
The value argument is the new origin point (i.e., a <a href="qpointf.html">QPointF</a>); to get the old origin point, call
<a href="qgraphicsitem.html#transformOriginPoint">transformOriginPoint</a>().
Do not call <a href="qgraphicsitem.html#setTransformOriginPoint">setTransformOriginPoint</a>()
in <a href="qgraphicsitem.html#itemChange">itemChange</a>() as this
notification is delivered; instead, you can return the new
transform origin point from <a href="qgraphicsitem.html#itemChange">itemChange</a>().</td>
</tr>
<tr>
<td class="topAlign">
<tt>QGraphicsItem.ItemTransformOriginPointHasChanged</tt></td>
<td class="topAlign"><tt>33</tt></td>
<td class="topAlign">The item's transform origin point property has
changed. This notification is sent if the <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemSendsGeometryChanges</a>
flag is enabled, and after the item's transform origin point
property has changed. The value argument is the new origin point
(i.e., a <a href="qpointf.html">QPointF</a>), and <a href="qgraphicsitem.html">QGraphicsItem</a> ignores the return value for
this notification (i.e., a read-only notification). Do not call
<a href="qgraphicsitem.html#setTransformOriginPoint">setTransformOriginPoint</a>()
in <a href="qgraphicsitem.html#itemChange">itemChange</a>() as this
notification is delivered.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QGraphicsItem.ItemSelectedChange</tt></td>
<td class="topAlign"><tt>4</tt></td>
<td class="topAlign">The item's selected state changes. If the item
is presently selected, it will become unselected, and vice verca.
The value argument is the new selected state (i.e., true or false).
Do not call <a href="qgraphicsitem.html#setSelected">setSelected</a>() in <a href="qgraphicsitem.html#itemChange">itemChange</a>() as this
notification is delivered; instead, you can return the new selected
state from <a href="qgraphicsitem.html#itemChange">itemChange</a>().</td>
</tr>
<tr>
<td class="topAlign">
<tt>QGraphicsItem.ItemSelectedHasChanged</tt></td>
<td class="topAlign"><tt>14</tt></td>
<td class="topAlign">The item's selected state has changed. The
value argument is the new selected state (i.e., true or false). Do
not call <a href="qgraphicsitem.html#setSelected">setSelected</a>()
in <a href="qgraphicsitem.html#itemChange">itemChange</a>() as this
notification is delivered. The return value is ignored.</td>
</tr>
<tr>
<td class="topAlign"><tt>QGraphicsItem.ItemVisibleChange</tt></td>
<td class="topAlign"><tt>2</tt></td>
<td class="topAlign">The item's visible state changes. If the item
is presently visible, it will become invisible, and vice verca. The
value argument is the new visible state (i.e., true or false). Do
not call <a href="qgraphicsitem.html#setVisible">setVisible</a>()
in <a href="qgraphicsitem.html#itemChange">itemChange</a>() as this
notification is delivered; instead, you can return the new visible
state from <a href="qgraphicsitem.html#itemChange">itemChange</a>().</td>
</tr>
<tr>
<td class="topAlign">
<tt>QGraphicsItem.ItemVisibleHasChanged</tt></td>
<td class="topAlign"><tt>12</tt></td>
<td class="topAlign">The item's visible state has changed. The
value argument is the new visible state (i.e., true or false). Do
not call <a href="qgraphicsitem.html#setVisible">setVisible</a>()
in <a href="qgraphicsitem.html#itemChange">itemChange</a>() as this
notification is delivered. The return value is ignored.</td>
</tr>
<tr>
<td class="topAlign"><tt>QGraphicsItem.ItemParentChange</tt></td>
<td class="topAlign"><tt>5</tt></td>
<td class="topAlign">The item's parent changes. The value argument
is the new parent item (i.e., a <a href="qgraphicsitem.html">QGraphicsItem</a> pointer). Do not call
<a href="qgraphicsitem.html#setParentItem">setParentItem</a>() in
<a href="qgraphicsitem.html#itemChange">itemChange</a>() as this
notification is delivered; instead, you can return the new parent
from <a href="qgraphicsitem.html#itemChange">itemChange</a>().</td>
</tr>
<tr>
<td class="topAlign">
<tt>QGraphicsItem.ItemParentHasChanged</tt></td>
<td class="topAlign"><tt>15</tt></td>
<td class="topAlign">The item's parent has changed. The value
argument is the new parent (i.e., a pointer to a <a href="qgraphicsitem.html">QGraphicsItem</a>). Do not call <a href="qgraphicsitem.html#setParentItem">setParentItem</a>() in <a href="qgraphicsitem.html#itemChange">itemChange</a>() as this
notification is delivered. The return value is ignored.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QGraphicsItem.ItemChildAddedChange</tt></td>
<td class="topAlign"><tt>6</tt></td>
<td class="topAlign">A child is added to this item. The value
argument is the new child item (i.e., a <a href="qgraphicsitem.html">QGraphicsItem</a> pointer). Do not pass this
item to any item's <a href="qgraphicsitem.html#setParentItem">setParentItem</a>() function as
this notification is delivered. The return value is unused; you
cannot adjust anything in this notification. Note that the new
child might not be fully constructed when this notification is
sent; calling pure virtual functions on the child can lead to a
crash.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QGraphicsItem.ItemChildRemovedChange</tt></td>
<td class="topAlign"><tt>7</tt></td>
<td class="topAlign">A child is removed from this item. The value
argument is the child item that is about to be removed (i.e., a
<a href="qgraphicsitem.html">QGraphicsItem</a> pointer). The return
value is unused; you cannot adjust anything in this
notification.</td>
</tr>
<tr>
<td class="topAlign"><tt>QGraphicsItem.ItemSceneChange</tt></td>
<td class="topAlign"><tt>11</tt></td>
<td class="topAlign">The item is moved to a new scene. This
notification is also sent when the item is added to its initial
scene, and when it is removed. The item's <a href="qgraphicsitem.html#scene">scene</a>() is the old scene (or 0 if
the item has not been added to a scene yet). The value argument is
the new scene (i.e., a <a href="qgraphicsscene.html">QGraphicsScene</a> pointer), or a null
pointer if the item is removed from a scene. Do not override this
change by passing this item to <a href="qgraphicsscene.html#addItem">QGraphicsScene.addItem</a>() as this
notification is delivered; instead, you can return the new scene
from <a href="qgraphicsitem.html#itemChange">itemChange</a>(). Use
this feature with caution; objecting to a scene change can quickly
lead to unwanted recursion.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QGraphicsItem.ItemSceneHasChanged</tt></td>
<td class="topAlign"><tt>16</tt></td>
<td class="topAlign">The item's scene has changed. The item's
<a href="qgraphicsitem.html#scene">scene</a>() is the new scene.
This notification is also sent when the item is added to its
initial scene, and when it is removed.The value argument is the new
scene (i.e., a pointer to a <a href="qgraphicsscene.html">QGraphicsScene</a>). Do not call setScene()
in <a href="qgraphicsitem.html#itemChange">itemChange</a>() as this
notification is delivered. The return value is ignored.</td>
</tr>
<tr>
<td class="topAlign"><tt>QGraphicsItem.ItemCursorChange</tt></td>
<td class="topAlign"><tt>17</tt></td>
<td class="topAlign">The item's cursor changes. The value argument
is the new cursor (i.e., a <a href="qcursor.html">QCursor</a>). Do
not call <a href="qgraphicsitem.html#setCursor">setCursor</a>() in
<a href="qgraphicsitem.html#itemChange">itemChange</a>() as this
notification is delivered. Instead, you can return a new cursor
from <a href="qgraphicsitem.html#itemChange">itemChange</a>().</td>
</tr>
<tr>
<td class="topAlign">
<tt>QGraphicsItem.ItemCursorHasChanged</tt></td>
<td class="topAlign"><tt>18</tt></td>
<td class="topAlign">The item's cursor has changed. The value
argument is the new cursor (i.e., a <a href="qcursor.html">QCursor</a>). Do not call <a href="qgraphicsitem.html#setCursor">setCursor</a>() as this notification
is delivered. The return value is ignored.</td>
</tr>
<tr>
<td class="topAlign"><tt>QGraphicsItem.ItemToolTipChange</tt></td>
<td class="topAlign"><tt>19</tt></td>
<td class="topAlign">The item's tooltip changes. The value argument
is the new tooltip (i.e., a <a href="qtooltip.html">QToolTip</a>).
Do not call <a href="qgraphicsitem.html#setToolTip">setToolTip</a>() in <a href="qgraphicsitem.html#itemChange">itemChange</a>() as this
notification is delivered. Instead, you can return a new tooltip
from <a href="qgraphicsitem.html#itemChange">itemChange</a>().</td>
</tr>
<tr>
<td class="topAlign">
<tt>QGraphicsItem.ItemToolTipHasChanged</tt></td>
<td class="topAlign"><tt>20</tt></td>
<td class="topAlign">The item's tooltip has changed. The value
argument is the new tooltip (i.e., a <a href="qtooltip.html">QToolTip</a>). Do not call <a href="qgraphicsitem.html#setToolTip">setToolTip</a>() as this
notification is delivered. The return value is ignored.</td>
</tr>
<tr>
<td class="topAlign"><tt>QGraphicsItem.ItemFlagsChange</tt></td>
<td class="topAlign"><tt>21</tt></td>
<td class="topAlign">The item's flags change. The value argument is
the new flags (i.e., a quint32). Do not call <a href="qgraphicsitem.html#setFlags">setFlags</a>() in <a href="qgraphicsitem.html#itemChange">itemChange</a>() as this
notification is delivered. Instead, you can return the new flags
from <a href="qgraphicsitem.html#itemChange">itemChange</a>().</td>
</tr>
<tr>
<td class="topAlign">
<tt>QGraphicsItem.ItemFlagsHaveChanged</tt></td>
<td class="topAlign"><tt>22</tt></td>
<td class="topAlign">The item's flags have changed. The value
argument is the new flags (i.e., a quint32). Do not call <a href="qgraphicsitem.html#setFlags">setFlags</a>() in <a href="qgraphicsitem.html#itemChange">itemChange</a>() as this
notification is delivered. The return value is ignored.</td>
</tr>
<tr>
<td class="topAlign"><tt>QGraphicsItem.ItemZValueChange</tt></td>
<td class="topAlign"><tt>23</tt></td>
<td class="topAlign">The item's Z-value changes. The value argument
is the new Z-value (i.e., a double). Do not call <a href="qgraphicsitem.html#setZValue">setZValue</a>() in <a href="qgraphicsitem.html#itemChange">itemChange</a>() as this
notification is delivered. Instead, you can return a new Z-value
from <a href="qgraphicsitem.html#itemChange">itemChange</a>().</td>
</tr>
<tr>
<td class="topAlign">
<tt>QGraphicsItem.ItemZValueHasChanged</tt></td>
<td class="topAlign"><tt>24</tt></td>
<td class="topAlign">The item's Z-value has changed. The value
argument is the new Z-value (i.e., a double). Do not call <a href="qgraphicsitem.html#setZValue">setZValue</a>() as this notification
is delivered. The return value is ignored.</td>
</tr>
<tr>
<td class="topAlign"><tt>QGraphicsItem.ItemOpacityChange</tt></td>
<td class="topAlign"><tt>25</tt></td>
<td class="topAlign">The item's opacity changes. The value argument
is the new opacity (i.e., a double). Do not call <a href="qgraphicsitem.html#setOpacity">setOpacity</a>() in <a href="qgraphicsitem.html#itemChange">itemChange</a>() as this
notification is delivered. Instead, you can return a new opacity
from <a href="qgraphicsitem.html#itemChange">itemChange</a>().</td>
</tr>
<tr>
<td class="topAlign">
<tt>QGraphicsItem.ItemOpacityHasChanged</tt></td>
<td class="topAlign"><tt>26</tt></td>
<td class="topAlign">The item's opacity has changed. The value
argument is the new opacity (i.e., a double). Do not call <a href="qgraphicsitem.html#setOpacity">setOpacity</a>() as this
notification is delivered. The return value is ignored.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QGraphicsItem.ItemScenePositionHasChanged</tt></td>
<td class="topAlign"><tt>27</tt></td>
<td class="topAlign">The item's scene position has changed. This
notification is sent if the <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemSendsScenePositionChanges</a>
flag is enabled, and after the item's scene position has changed
(i.e., the position or transformation of the item itself or the
position or transformation of any ancestor has changed). The value
argument is the new scene position (the same as <a href="qgraphicsitem.html#scenePos">scenePos</a>()), and <a href="qgraphicsitem.html">QGraphicsItem</a> ignores the return value for
this notification (i.e., a read-only notification).</td>
</tr>
</table>


<h3 class="fn"><a name="GraphicsItemFlag-enum" />QGraphicsItem.GraphicsItemFlag</h3><p>This enum describes different flags that you can set on an item
to toggle different features in the item's behavior.</p>
<p>All flags are disabled by default.</p>
<table class="valuelist">
<tr class="odd" valign="top">
<th class="tblConst">Constant</th>
<th class="tblval">Value</th>
<th class="tbldscr">Description</th>
</tr>
<tr>
<td class="topAlign"><tt>QGraphicsItem.ItemIsMovable</tt></td>
<td class="topAlign"><tt>0x1</tt></td>
<td class="topAlign">The item supports interactive movement using
the mouse. By clicking on the item and then dragging, the item will
move together with the mouse cursor. If the item has children, all
children are also moved. If the item is part of a selection, all
selected items are also moved. This feature is provided as a
convenience through the base implementation of <a href="qgraphicsitem.html">QGraphicsItem</a>'s mouse event handlers.</td>
</tr>
<tr>
<td class="topAlign"><tt>QGraphicsItem.ItemIsSelectable</tt></td>
<td class="topAlign"><tt>0x2</tt></td>
<td class="topAlign">The item supports selection. Enabling this
feature will enable <a href="qgraphicsitem.html#setSelected">setSelected</a>() to toggle
selection for the item. It will also let the item be selected
automatically as a result of calling <a href="qgraphicsscene.html#setSelectionArea">QGraphicsScene.setSelectionArea</a>(),
by clicking on an item, or by using rubber band selection in
<a href="qgraphicsview.html">QGraphicsView</a>.</td>
</tr>
<tr>
<td class="topAlign"><tt>QGraphicsItem.ItemIsFocusable</tt></td>
<td class="topAlign"><tt>0x4</tt></td>
<td class="topAlign">The item supports keyboard input focus (i.e.,
it is an input item). Enabling this flag will allow the item to
accept focus, which again allows the delivery of key events to
<a href="qgraphicsitem.html#keyPressEvent">QGraphicsItem.keyPressEvent</a>()
and <a href="qgraphicsitem.html#keyReleaseEvent">QGraphicsItem.keyReleaseEvent</a>().</td>
</tr>
<tr>
<td class="topAlign"><tt>QGraphicsItem.ItemClipsToShape</tt></td>
<td class="topAlign"><tt>0x8</tt></td>
<td class="topAlign">The item clips to its own shape. The item
cannot draw or receive mouse, tablet, drag and drop or hover events
outside its shape. It is disabled by default. This behavior is
enforced by <a class="obsolete" href="qgraphicsview-obsolete.html#drawItems">QGraphicsView.drawItems</a>() or <a class="obsolete" href="qgraphicsscene-obsolete.html#drawItems">QGraphicsScene.drawItems</a>(). This flag was
introduced in Qt 4.3.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QGraphicsItem.ItemClipsChildrenToShape</tt></td>
<td class="topAlign"><tt>0x10</tt></td>
<td class="topAlign">The item clips the painting of all its
descendants to its own shape. Items that are either direct or
indirect children of this item cannot draw outside this item's
shape. By default, this flag is disabled; children can draw
anywhere. This behavior is enforced by <a class="obsolete" href="qgraphicsview-obsolete.html#drawItems">QGraphicsView.drawItems</a>() or <a class="obsolete" href="qgraphicsscene-obsolete.html#drawItems">QGraphicsScene.drawItems</a>(). This flag was
introduced in Qt 4.3.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QGraphicsItem.ItemIgnoresTransformations</tt></td>
<td class="topAlign"><tt>0x20</tt></td>
<td class="topAlign">The item ignores inherited transformations
(i.e., its position is still anchored to its parent, but the parent
or view rotation, zoom or shear transformations are ignored). This
flag is useful for keeping text label items horizontal and
unscaled, so they will still be readable if the view is
transformed. When set, the item's view geometry and scene geometry
will be maintained separately. You must call <a href="qgraphicsitem.html#deviceTransform">deviceTransform</a>() to map
coordinates and detect collisions in the view. By default, this
flag is disabled. This flag was introduced in Qt 4.3. <b>Note:</b>
With this flag set you can still scale the item itself, and that
scale transformation will influence the item's children.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QGraphicsItem.ItemIgnoresParentOpacity</tt></td>
<td class="topAlign"><tt>0x40</tt></td>
<td class="topAlign">The item ignores its parent's opacity. The
item's effective opacity is the same as its own; it does not
combine with the parent's opacity. This flags allows your item to
keep its absolute opacity even if the parent is semitransparent.
This flag was introduced in Qt 4.5.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QGraphicsItem.ItemDoesntPropagateOpacityToChildren</tt></td>
<td class="topAlign"><tt>0x80</tt></td>
<td class="topAlign">The item doesn't propagate its opacity to its
children. This flag allows you to create a semitransparent item
that does not affect the opacity of its children. This flag was
introduced in Qt 4.5.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QGraphicsItem.ItemStacksBehindParent</tt></td>
<td class="topAlign"><tt>0x100</tt></td>
<td class="topAlign">The item is stacked behind its parent. By
default, child items are stacked on top of the parent item. But
setting this flag, the child will be stacked behind it. This flag
is useful for drop shadow effects and for decoration objects that
follow the parent item's geometry without drawing on top of it.
This flag was introduced in Qt 4.5.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QGraphicsItem.ItemUsesExtendedStyleOption</tt></td>
<td class="topAlign"><tt>0x200</tt></td>
<td class="topAlign">The item makes use of either <a href="qstyleoptiongraphicsitem.html#exposedRect-var">exposedRect</a> or
<a class="obsolete" href="qstyleoptiongraphicsitem-obsolete.html#matrix-var">matrix<sup>(obsolete)</sup></a> in <a href="qstyleoptiongraphicsitem.html">QStyleOptionGraphicsItem</a>. By
default, the <a href="qstyleoptiongraphicsitem.html#exposedRect-var">exposedRect</a> is
initialized to the item's <a href="qgraphicsitem.html#boundingRect">boundingRect</a>() and the
<a class="obsolete" href="qstyleoptiongraphicsitem-obsolete.html#matrix-var">matrix<sup>(obsolete)</sup></a> is untransformed. You
can enable this flag for the style options to be set up with more
fine-grained values. Note that <a class="obsolete" href="qstyleoptiongraphicsitem-obsolete.html#levelOfDetail-var">QStyleOptionGraphicsItem.levelOfDetail<sup>(obsolete)</sup></a>
is unaffected by this flag and always initialized to 1. Use
<a href="qstyleoptiongraphicsitem.html#levelOfDetailFromTransform">QStyleOptionGraphicsItem.levelOfDetailFromTransform</a>()
if you need a higher value. This flag was introduced in Qt
4.6.</td>
</tr>
<tr>
<td class="topAlign"><tt>QGraphicsItem.ItemHasNoContents</tt></td>
<td class="topAlign"><tt>0x400</tt></td>
<td class="topAlign">The item does not paint anything (i.e.,
calling <a href="qgraphicsitem.html#paint">paint</a>() on the item
has no effect). You should set this flag on items that do not need
to be painted to ensure that Graphics View avoids unnecessary
painting preparations. This flag was introduced in Qt 4.6.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QGraphicsItem.ItemSendsGeometryChanges</tt></td>
<td class="topAlign"><tt>0x800</tt></td>
<td class="topAlign">The item enables <a href="qgraphicsitem.html#itemChange">itemChange</a>() notifications for
<a href="qgraphicsitem.html#GraphicsItemChange-enum">ItemPositionChange</a>,
<a href="qgraphicsitem.html#GraphicsItemChange-enum">ItemPositionHasChanged</a>,
<a href="qgraphicsitem.html#GraphicsItemChange-enum">ItemMatrixChange</a>,
<a href="qgraphicsitem.html#GraphicsItemChange-enum">ItemTransformChange</a>,
<a href="qgraphicsitem.html#GraphicsItemChange-enum">ItemTransformHasChanged</a>,
<a href="qgraphicsitem.html#GraphicsItemChange-enum">ItemRotationChange</a>,
<a href="qgraphicsitem.html#GraphicsItemChange-enum">ItemRotationHasChanged</a>,
<a href="qgraphicsitem.html#GraphicsItemChange-enum">ItemScaleChange</a>,
<a href="qgraphicsitem.html#GraphicsItemChange-enum">ItemScaleHasChanged</a>,
<a href="qgraphicsitem.html#GraphicsItemChange-enum">ItemTransformOriginPointChange</a>,
and <a href="qgraphicsitem.html#GraphicsItemChange-enum">ItemTransformOriginPointHasChanged</a>.
For performance reasons, these notifications are disabled by
default. You must enable this flag to receive notifications for
position and transform changes. This flag was introduced in Qt
4.6.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QGraphicsItem.ItemAcceptsInputMethod</tt></td>
<td class="topAlign"><tt>0x1000</tt></td>
<td class="topAlign">The item supports input methods typically used
for Asian languages. This flag was introduced in Qt 4.6.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QGraphicsItem.ItemNegativeZStacksBehindParent</tt></td>
<td class="topAlign"><tt>0x2000</tt></td>
<td class="topAlign">The item automatically stacks behind it's
parent if it's z-value is negative. This flag enables <a href="qgraphicsitem.html#setZValue">setZValue</a>() to toggle
ItemStacksBehindParent. This flag was introduced in Qt 4.6.</td>
</tr>
<tr>
<td class="topAlign"><tt>QGraphicsItem.ItemIsPanel</tt></td>
<td class="topAlign"><tt>0x4000</tt></td>
<td class="topAlign">The item is a panel. A panel provides
activation and contained focus handling. Only one panel can be
active at a time (see <a href="qgraphicsitem.html#isActive">QGraphicsItem.isActive</a>()). When
no panel is active, <a href="qgraphicsscene.html">QGraphicsScene</a> activates all non-panel
items. Window items (i.e., <a href="qgraphicsitem.html#isWindow">QGraphicsItem.isWindow</a>() returns
true) are panels. This flag was introduced in Qt 4.6.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QGraphicsItem.ItemSendsScenePositionChanges</tt></td>
<td class="topAlign"><tt>0x10000</tt></td>
<td class="topAlign">The item enables <a href="qgraphicsitem.html#itemChange">itemChange</a>() notifications for
<a href="qgraphicsitem.html#GraphicsItemChange-enum">ItemScenePositionHasChanged</a>.
For performance reasons, these notifications are disabled by
default. You must enable this flag to receive notifications for
scene position changes. This flag was introduced in Qt 4.6.</td>
</tr>
</table>
<p>The GraphicsItemFlags type is a typedef for <a href="qflags.html">QFlags</a>&lt;GraphicsItemFlag&gt;. It stores an OR
combination of GraphicsItemFlag values.</p>


<h3 class="fn"><a name="PanelModality-enum" />QGraphicsItem.PanelModality</h3><p>This enum specifies the behavior of a modal panel. A modal panel
is one that blocks input to other panels. Note that items that are
children of a modal panel are not blocked.</p>
<p>The values are:</p>
<table class="valuelist">
<tr class="odd" valign="top">
<th class="tblConst">Constant</th>
<th class="tblval">Value</th>
<th class="tbldscr">Description</th>
</tr>
<tr>
<td class="topAlign"><tt>QGraphicsItem.NonModal</tt></td>
<td class="topAlign"><tt>0</tt></td>
<td class="topAlign">The panel is not modal and does not block
input to other panels. This is the default value for panels.</td>
</tr>
<tr>
<td class="topAlign"><tt>QGraphicsItem.PanelModal</tt></td>
<td class="topAlign"><tt>1</tt></td>
<td class="topAlign">The panel is modal to a single item hierarchy
and blocks input to its parent pane, all grandparent panels, and
all siblings of its parent and grandparent panels.</td>
</tr>
<tr>
<td class="topAlign"><tt>QGraphicsItem.SceneModal</tt></td>
<td class="topAlign"><tt>2</tt></td>
<td class="topAlign">The window is modal to the entire scene and
blocks input to all panels.</td>
</tr>
</table>
<p>This enum was introduced or modified in Qt 4.6.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#setPanelModality">QGraphicsItem.setPanelModality</a>(),
<a href="qgraphicsitem.html#panelModality">QGraphicsItem.panelModality</a>(),
and <a href="qgraphicsitem.html#GraphicsItemFlag-enum">QGraphicsItem.ItemIsPanel</a>.</p>
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QGraphicsItem" />QGraphicsItem.__init__ (<i>self</i>, <a href="qgraphicsitem.html">QGraphicsItem</a>&#160;<i>parent</i>&#160;=&#160;None, <a href="qgraphicsscene.html">QGraphicsScene</a>&#160;<i>scene</i>&#160;=&#160;None)</h3><p>The <i>parent</i> argument, if not None, causes <i>self</i> to be owned by Qt instead of PyQt.</p><p>The <i>scene</i> argument, if not None, causes <i>self</i> to be owned by Qt instead of PyQt.</p><p>Constructs a <a href="qgraphicsitem.html">QGraphicsItem</a> with
the given <i>parent</i> item. It does not modify the parent object
returned by <a href="qobject.html#parent">QObject.parent</a>().</p>
<p>If <i>parent</i> is 0, you can add the item to a scene by
calling <a href="qgraphicsscene.html#addItem">QGraphicsScene.addItem</a>(). The
item will then become a top-level item.</p>
<p><b>See also</b> <a href="qgraphicsscene.html#addItem">QGraphicsScene.addItem</a>() and
<a href="qgraphicsitem.html#setParentItem">setParentItem</a>().</p>


<h3 class="fn"><a name="acceptDrops" />bool QGraphicsItem.acceptDrops (<i>self</i>)</h3><p>Returns true if this item can accept drag and drop events;
otherwise, returns false. By default, items do not accept drag and
drop events; items are transparent to drag and drop.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#setAcceptDrops">setAcceptDrops</a>().</p>


<h3 class="fn"><a name="acceptedMouseButtons" /><a href="qt-mousebuttons.html">Qt.MouseButtons</a> QGraphicsItem.acceptedMouseButtons (<i>self</i>)</h3><p>Returns the mouse buttons that this item accepts mouse events
for. By default, all mouse buttons are accepted.</p>
<p>If an item accepts a mouse button, it will become the mouse
grabber item when a mouse press event is delivered for that mouse
button. However, if the item does not accept the button, <a href="qgraphicsscene.html">QGraphicsScene</a> will forward the mouse
events to the first item beneath it that does.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#setAcceptedMouseButtons">setAcceptedMouseButtons</a>()
and <a href="qgraphicsitem.html#mousePressEvent">mousePressEvent</a>().</p>


<h3 class="fn"><a name="acceptHoverEvents" />bool QGraphicsItem.acceptHoverEvents (<i>self</i>)</h3><p>Returns true if an item accepts hover events (<a href="qgraphicsscenehoverevent.html">QGraphicsSceneHoverEvent</a>);
otherwise, returns false. By default, items do not accept hover
events.</p>
<p>This function was introduced in Qt 4.4.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#setAcceptHoverEvents">setAcceptHoverEvents</a>()
and <a href="qgraphicsitem.html#setAcceptedMouseButtons">setAcceptedMouseButtons</a>().</p>


<h3 class="fn"><a name="acceptsHoverEvents" />bool QGraphicsItem.acceptsHoverEvents (<i>self</i>)</h3><h3 class="fn"><a name="acceptTouchEvents" />bool QGraphicsItem.acceptTouchEvents (<i>self</i>)</h3><p>Returns true if an item accepts <a href="qtouchevent.html">touch
events</a>; otherwise, returns false. By default, items do not
accept touch events.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#setAcceptTouchEvents">setAcceptTouchEvents</a>().</p>


<h3 class="fn"><a name="advance" />QGraphicsItem.advance (<i>self</i>, int&#160;<i>phase</i>)</h3><p>This virtual function is called twice for all items by the
<a href="qgraphicsscene.html#advance">QGraphicsScene.advance</a>()
slot. In the first phase, all items are called with <i>phase</i> ==
0, indicating that items on the scene are about to advance, and
then all items are called with <i>phase</i> == 1. Reimplement this
function to update your item if you need simple scene-controlled
animation.</p>
<p>The default implementation does nothing.</p>
<p>For individual item animation, an alternative to this function
is to either use <a href="qgraphicsitemanimation.html">QGraphicsItemAnimation</a>, or to
multiple-inherit from <a href="qobject.html">QObject</a> and
<a href="qgraphicsitem.html">QGraphicsItem</a>, and animate your
item using <a href="qobject.html#startTimer">QObject.startTimer</a>() and <a href="qobject.html#timerEvent">QObject.timerEvent</a>().</p>
<p><b>See also</b> <a href="qgraphicsitemanimation.html">QGraphicsItemAnimation</a> and
<a href="qtimeline.html">QTimeLine</a>.</p>


<h3 class="fn"><a name="boundingRect" /><a href="qrectf.html">QRectF</a> QGraphicsItem.boundingRect (<i>self</i>)</h3><p>This method is abstract and should be reimplemented in any sub-class.</p><p>This pure virtual function defines the outer bounds of the item
as a rectangle; all painting must be restricted to inside an item's
bounding rect. <a href="qgraphicsview.html">QGraphicsView</a> uses
this to determine whether the item requires redrawing.</p>
<p>Although the item's shape can be arbitrary, the bounding rect is
always rectangular, and it is unaffected by the items'
transformation.</p>
<p>If you want to change the item's bounding rectangle, you must
first call <a href="qgraphicsitem.html#prepareGeometryChange">prepareGeometryChange</a>().
This notifies the scene of the imminent change, so that its can
update its item geometry index; otherwise, the scene will be
unaware of the item's new geometry, and the results are undefined
(typically, rendering artifacts are left around in the view).</p>
<p>Reimplement this function to let <a href="qgraphicsview.html">QGraphicsView</a> determine what parts of the
widget, if any, need to be redrawn.</p>
<p>Note: For shapes that paint an outline / stroke, it is important
to include half the pen width in the bounding rect. It is not
necessary to compensate for antialiasing, though.</p>
<p>Example:</p>
<pre class="cpp">
 <span class="type"><a href="qrectf.html">QRectF</a></span> CircleItem<span class="operator">.</span>boundingRect() <span class="keyword">const</span>
 {
     <span class="type"><a href="qtcore.html#qreal-typedef">qreal</a></span> penWidth <span class="operator">=</span> <span class="number">1</span>;
     <span class="keyword">return</span> <span class="type"><a href="qrectf.html">QRectF</a></span>(<span class="operator">-</span>radius <span class="operator">-</span> penWidth <span class="operator">/</span> <span class="number">2</span><span class="operator">,</span> <span class="operator">-</span>radius <span class="operator">-</span> penWidth <span class="operator">/</span> <span class="number">2</span><span class="operator">,</span>
                   diameter <span class="operator">+</span> penWidth<span class="operator">,</span> diameter <span class="operator">+</span> penWidth);
 }
</pre>
<p><b>See also</b> <a href="qgraphicsitem.html#boundingRegion">boundingRegion</a>(), <a href="qgraphicsitem.html#shape">shape</a>(), <a href="qgraphicsitem.html#contains">contains</a>(), <a href="graphicsview.html#the-graphics-view-coordinate-system">The
Graphics View Coordinate System</a>, and <a href="qgraphicsitem.html#prepareGeometryChange">prepareGeometryChange</a>().</p>


<h3 class="fn"><a name="boundingRegion" /><a href="qregion.html">QRegion</a> QGraphicsItem.boundingRegion (<i>self</i>, <a href="qtransform.html">QTransform</a>&#160;<i>itemToDeviceTransform</i>)</h3><p>Returns the bounding region for this item. The coordinate space
of the returned region depends on <i>itemToDeviceTransform</i>. If
you pass an identity <a href="qtransform.html">QTransform</a> as a
parameter, this function will return a local coordinate region.</p>
<p>The bounding region describes a coarse outline of the item's
visual contents. Although it's expensive to calculate, it's also
more precise than <a href="qgraphicsitem.html#boundingRect">boundingRect</a>(), and it can
help to avoid unnecessary repainting when an item is updated. This
is particularly efficient for thin items (e.g., lines or simple
polygons). You can tune the granularity for the bounding region by
calling <a href="qgraphicsitem.html#setBoundingRegionGranularity">setBoundingRegionGranularity</a>().
The default granularity is 0; in which the item's bounding region
is the same as its bounding rect.</p>
<p><i>itemToDeviceTransform</i> is the transformation from item
coordinates to device coordinates. If you want this function to
return a <a href="qregion.html">QRegion</a> in scene coordinates,
you can pass <a href="qgraphicsitem.html#sceneTransform">sceneTransform</a>() as an
argument.</p>
<p>This function was introduced in Qt 4.4.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#boundingRegionGranularity">boundingRegionGranularity</a>().</p>


<h3 class="fn"><a name="boundingRegionGranularity" />float QGraphicsItem.boundingRegionGranularity (<i>self</i>)</h3><p>Returns the item's bounding region granularity; a value between
and including 0 and 1. The default value is 0 (i.e., the lowest
granularity, where the bounding region corresponds to the item's
bounding rectangle).</p>
<p>This function was introduced in Qt 4.4.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#setBoundingRegionGranularity">setBoundingRegionGranularity</a>().</p>


<h3 class="fn"><a name="cacheMode" /><a href="qgraphicsitem.html#CacheMode-enum">CacheMode</a> QGraphicsItem.cacheMode (<i>self</i>)</h3><p>Returns the cache mode for this item. The default mode is
<a href="qgraphicsitem.html#CacheMode-enum">NoCache</a> (i.e.,
cache is disabled and all painting is immediate).</p>
<p>This function was introduced in Qt 4.4.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#setCacheMode">setCacheMode</a>().</p>


<h3 class="fn"><a name="childItems" />list-of-QGraphicsItem QGraphicsItem.childItems (<i>self</i>)</h3><p>Returns a list of this item's children.</p>
<p>The items are sorted by stacking order. This takes into account
both the items' insertion order and their Z-values.</p>
<p>This function was introduced in Qt 4.4.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#setParentItem">setParentItem</a>(), <a href="qgraphicsitem.html#zValue">zValue</a>(), and <a href="qgraphicsitem.html#sorting">Sorting</a>.</p>


<h3 class="fn"><a name="childrenBoundingRect" /><a href="qrectf.html">QRectF</a> QGraphicsItem.childrenBoundingRect (<i>self</i>)</h3><p>Returns the bounding rect of this item's descendants (i.e., its
children, their children, etc.) in local coordinates. The rectangle
will contain all descendants after they have been mapped to local
coordinates. If the item has no children, this function returns an
empty <a href="qrectf.html">QRectF</a>.</p>
<p>This does not include this item's own bounding rect; it only
returns its descendants' accumulated bounding rect. If you need to
include this item's bounding rect, you can add <a href="qgraphicsitem.html#boundingRect">boundingRect</a>() to
childrenBoundingRect() using QRectF.operator|().</p>
<p>This function is linear in complexity; it determines the size of
the returned bounding rect by iterating through all
descendants.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#boundingRect">boundingRect</a>() and <a href="qgraphicsitem.html#sceneBoundingRect">sceneBoundingRect</a>().</p>


<h3 class="fn"><a name="clearFocus" />QGraphicsItem.clearFocus (<i>self</i>)</h3><p>Takes keyboard input focus from the item.</p>
<p>If it has focus, a <a href="qgraphicsitem.html#focusOutEvent">focus out event</a> is sent to
this item to tell it that it is about to lose the focus.</p>
<p>Only items that set the <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemIsFocusable</a>
flag, or widgets that set an appropriate focus policy, can accept
keyboard focus.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#setFocus">setFocus</a>(), <a href="qgraphicsitem.html#hasFocus">hasFocus</a>(), and <a href="qgraphicswidget.html#focusPolicy-prop">QGraphicsWidget.focusPolicy</a>.</p>


<h3 class="fn"><a name="clipPath" /><a href="qpainterpath.html">QPainterPath</a> QGraphicsItem.clipPath (<i>self</i>)</h3><p>Returns this item's clip path, or an empty <a href="qpainterpath.html">QPainterPath</a> if this item is not clipped.
The clip path constrains the item's appearance and interaction
(i.e., restricts the area the item can draw, and it also restricts
the area that the item receives events).</p>
<p>You can enable clipping by setting the <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemClipsToShape</a> or
<a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemClipsChildrenToShape</a>
flags. The item's clip path is calculated by intersecting all
clipping ancestors' shapes. If the item sets <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemClipsToShape</a>,
the final clip is intersected with the item's own shape.</p>
<p><b>Note:</b> Clipping introduces a performance penalty for all
items involved; you should generally avoid using clipping if you
can (e.g., if your items always draw inside <a href="qgraphicsitem.html#boundingRect">boundingRect</a>() or <a href="qgraphicsitem.html#shape">shape</a>() boundaries, clipping is not
necessary).</p>
<p>This function was introduced in Qt 4.5.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#isClipped">isClipped</a>(), <a href="qgraphicsitem.html#shape">shape</a>(), and <a href="qgraphicsitem.html#setFlags">setFlags</a>().</p>


<h3 class="fn"><a name="collidesWithItem" />bool QGraphicsItem.collidesWithItem (<i>self</i>, <a href="qgraphicsitem.html">QGraphicsItem</a>&#160;<i>other</i>, <a href="qt.html#ItemSelectionMode-enum">Qt.ItemSelectionMode</a>&#160;<i>mode</i>&#160;=&#160;Qt.IntersectsItemShape)</h3><p>Returns true if this item collides with <i>other</i>; otherwise
returns false.</p>
<p>The <i>mode</i> is applied to <i>other</i>, and the resulting
shape or bounding rectangle is then compared to this item's shape.
The default value for <i>mode</i> is <a href="qt.html#ItemSelectionMode-enum">Qt.IntersectsItemShape</a>;
<i>other</i> collides with this item if it either intersects,
contains, or is contained by this item's shape (see <a href="qt.html#ItemSelectionMode-enum">Qt.ItemSelectionMode</a> for
details).</p>
<p>The default implementation is based on shape intersection, and
it calls <a href="qgraphicsitem.html#shape">shape</a>() on both
items. Because the complexity of arbitrary shape-shape intersection
grows with an order of magnitude when the shapes are complex, this
operation can be noticably time consuming. You have the option of
reimplementing this function in a subclass of <a href="qgraphicsitem.html">QGraphicsItem</a> to provide a custom
algorithm. This allows you to make use of natural constraints in
the shapes of your own items, in order to improve the performance
of the collision detection. For instance, two untransformed
perfectly circular items' collision can be determined very
efficiently by comparing their positions and radii.</p>
<p>Keep in mind that when reimplementing this function and calling
<a href="qgraphicsitem.html#shape">shape</a>() or <a href="qgraphicsitem.html#boundingRect">boundingRect</a>() on
<i>other</i>, the returned coordinates must be mapped to this
item's coordinate system before any intersection can take
place.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#contains">contains</a>() and <a href="qgraphicsitem.html#shape">shape</a>().</p>


<h3 class="fn"><a name="collidesWithPath" />bool QGraphicsItem.collidesWithPath (<i>self</i>, <a href="qpainterpath.html">QPainterPath</a>&#160;<i>path</i>, <a href="qt.html#ItemSelectionMode-enum">Qt.ItemSelectionMode</a>&#160;<i>mode</i>&#160;=&#160;Qt.IntersectsItemShape)</h3><p>Returns true if this item collides with <i>path</i>.</p>
<p>The collision is determined by <i>mode</i>. The default value
for <i>mode</i> is <a href="qt.html#ItemSelectionMode-enum">Qt.IntersectsItemShape</a>;
<i>path</i> collides with this item if it either intersects,
contains, or is contained by this item's shape.</p>
<p>Note that this function checks whether the item's shape or
bounding rectangle (depending on <i>mode</i>) is contained within
<i>path</i>, and not whether <i>path</i> is contained within the
items shape or bounding rectangle.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#collidesWithItem">collidesWithItem</a>(),
<a href="qgraphicsitem.html#contains">contains</a>(), and <a href="qgraphicsitem.html#shape">shape</a>().</p>


<h3 class="fn"><a name="collidingItems" />list-of-QGraphicsItem QGraphicsItem.collidingItems (<i>self</i>, <a href="qt.html#ItemSelectionMode-enum">Qt.ItemSelectionMode</a>&#160;<i>mode</i>&#160;=&#160;Qt.IntersectsItemShape)</h3><p>Returns a list of all items that collide with this item.</p>
<p>The way collisions are detected is determined by applying
<i>mode</i> to items that are compared to this item, i.e., each
item's shape or bounding rectangle is checked against this item's
shape. The default value for <i>mode</i> is <a href="qt.html#ItemSelectionMode-enum">Qt.IntersectsItemShape</a>.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#collidesWithItem">collidesWithItem</a>().</p>


<h3 class="fn"><a name="commonAncestorItem" /><a href="qgraphicsitem.html">QGraphicsItem</a> QGraphicsItem.commonAncestorItem (<i>self</i>, <a href="qgraphicsitem.html">QGraphicsItem</a>&#160;<i>other</i>)</h3><p>Returns the closest common ancestor item of this item and
<i>other</i>, or 0 if either <i>other</i> is 0, or there is no
common ancestor.</p>
<p>This function was introduced in Qt 4.4.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#isAncestorOf">isAncestorOf</a>().</p>


<h3 class="fn"><a name="contains" />bool QGraphicsItem.contains (<i>self</i>, <a href="qpointf.html">QPointF</a>&#160;<i>point</i>)</h3><p>Returns true if this item contains <i>point</i>, which is in
local coordinates; otherwise, false is returned. It is most often
called from <a href="qgraphicsview.html">QGraphicsView</a> to
determine what item is under the cursor, and for that reason, the
implementation of this function should be as light-weight as
possible.</p>
<p>By default, this function calls <a href="qgraphicsitem.html#shape">shape</a>(), but you can reimplement it
in a subclass to provide a (perhaps more efficient)
implementation.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#shape">shape</a>(),
<a href="qgraphicsitem.html#boundingRect">boundingRect</a>(), and
<a href="qgraphicsitem.html#collidesWithPath">collidesWithPath</a>().</p>


<h3 class="fn"><a name="contextMenuEvent" />QGraphicsItem.contextMenuEvent (<i>self</i>, <a href="qgraphicsscenecontextmenuevent.html">QGraphicsSceneContextMenuEvent</a>&#160;<i>event</i>)</h3><p>This event handler can be reimplemented in a subclass to process
context menu events. The <i>event</i> parameter contains details
about the event to be handled.</p>
<p>If you ignore the event, (i.e., by calling <a href="qevent.html#ignore">QEvent.ignore</a>(),) <i>event</i> will
propagate to any item beneath this item. If no items accept the
event, it will be ignored by the scene, and propagate to the
view.</p>
<p>It's common to open a <a href="qmenu.html">QMenu</a> in response
to receiving a context menu event. Example:</p>
<pre class="cpp">
 <span class="type">void</span> CustomItem<span class="operator">.</span>contextMenuEvent(<span class="type"><a href="qgraphicsscenecontextmenuevent.html">QGraphicsSceneContextMenuEvent</a></span> <span class="operator">*</span>event)
 {
     <span class="type"><a href="qmenu.html">QMenu</a></span> menu;
     <span class="type"><a href="qaction.html">QAction</a></span> <span class="operator">*</span>removeAction <span class="operator">=</span> menu<span class="operator">.</span>addAction(<span class="string">"Remove"</span>);
     <span class="type"><a href="qaction.html">QAction</a></span> <span class="operator">*</span>markAction <span class="operator">=</span> menu<span class="operator">.</span>addAction(<span class="string">"Mark"</span>);
     <span class="type"><a href="qaction.html">QAction</a></span> <span class="operator">*</span>selectedAction <span class="operator">=</span> menu<span class="operator">.</span>exec(event<span class="operator">-</span><span class="operator">&gt;</span>screenPos());
     <span class="comment">// ...</span>
 }
</pre>
<p>The default implementation ignores the event.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#sceneEvent">sceneEvent</a>().</p>


<h3 class="fn"><a name="cursor" /><a href="qcursor.html">QCursor</a> QGraphicsItem.cursor (<i>self</i>)</h3><p>Returns the current cursor shape for the item. The mouse cursor
will assume this shape when it's over this item. See the <a href="qt.html#CursorShape-enum">list of predefined cursor objects</a>
for a range of useful shapes.</p>
<p>An editor item might want to use an I-beam cursor:</p>
<pre class="cpp">
 item<span class="operator">-</span><span class="operator">&gt;</span><a href="qgraphicsitem.html#setCursor">setCursor</a>(<span class="type"><a href="qt.html">Qt</a></span><span class="operator">.</span>IBeamCursor);
</pre>
<p>If no cursor has been set, the cursor of the item beneath is
used.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#setCursor">setCursor</a>(), <a href="qgraphicsitem.html#hasCursor">hasCursor</a>(), <a href="qgraphicsitem.html#unsetCursor">unsetCursor</a>(), <a href="qwidget.html#cursor-prop">QWidget.cursor</a>, and <a href="qapplication.html#overrideCursor">QApplication.overrideCursor</a>().</p>


<h3 class="fn"><a name="data" />QVariant QGraphicsItem.data (<i>self</i>, int&#160;<i>key</i>)</h3><p>Returns this item's custom data for the key <i>key</i> as a
<a href="qvariant.html">QVariant</a>.</p>
<p>Custom item data is useful for storing arbitrary properties in
any item. Example:</p>
<pre class="cpp">
 <span class="keyword">static</span> <span class="keyword">const</span> <span class="type">int</span> ObjectName <span class="operator">=</span> <span class="number">0</span>;

 <span class="type"><a href="qgraphicsitem.html">QGraphicsItem</a></span> <span class="operator">*</span>item <span class="operator">=</span> scene<span class="operator">.</span>itemAt(<span class="number">100</span><span class="operator">,</span> <span class="number">50</span>);
 <span class="keyword">if</span> (item<span class="operator">-</span><span class="operator">&gt;</span>data(ObjectName)<span class="operator">.</span>toString()<span class="operator">.</span>isEmpty()) {
     <span class="keyword">if</span> (qgraphicsitem_cast<span class="operator">&lt;</span>ButtonItem <span class="operator">*</span><span class="operator">&gt;</span>(item))
         item<span class="operator">-</span><span class="operator">&gt;</span>setData(ObjectName<span class="operator">,</span> <span class="string">"Button"</span>);
 }
</pre>
<p>Qt does not use this feature for storing data; it is provided
solely for the convenience of the user.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#setData">setData</a>().</p>


<h3 class="fn"><a name="deviceTransform" /><a href="qtransform.html">QTransform</a> QGraphicsItem.deviceTransform (<i>self</i>, <a href="qtransform.html">QTransform</a>&#160;<i>viewportTransform</i>)</h3><p>Returns this item's device transformation matrix, using
<i>viewportTransform</i> to map from scene to device coordinates.
This matrix can be used to map coordinates and geometrical shapes
from this item's local coordinate system to the viewport's (or any
device's) coordinate system. To map coordinates from the viewport,
you must first invert the returned matrix.</p>
<p>Example:</p>
<pre class="cpp">
 <span class="type"><a href="qgraphicsrectitem.html">QGraphicsRectItem</a></span> rect;
 rect<span class="operator">.</span><a href="qgraphicsitem.html#setPos">setPos</a>(<span class="number">100</span><span class="operator">,</span> <span class="number">100</span>);

 rect<span class="operator">.</span>deviceTransform(view<span class="operator">-</span><span class="operator">&gt;</span>viewportTransform())<span class="operator">.</span>map(<span class="type"><a href="qpointf.html">QPointF</a></span>(<span class="number">0</span><span class="operator">,</span> <span class="number">0</span>));
 <span class="comment">// returns the item's (0, 0) point in view's viewport coordinates</span>

 rect<span class="operator">.</span>deviceTransform(view<span class="operator">-</span><span class="operator">&gt;</span>viewportTransform())<span class="operator">.</span>inverted()<span class="operator">.</span>map(<span class="type"><a href="qpointf.html">QPointF</a></span>(<span class="number">100</span><span class="operator">,</span> <span class="number">100</span>));
 <span class="comment">// returns view's viewport's (100, 100) coordinate in item coordinates</span>
</pre>
<p>This function is the same as combining this item's scene
transform with the view's viewport transform, but it also
understands the <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemIgnoresTransformations</a>
flag. The device transform can be used to do accurate coordinate
mapping (and collision detection) for untransformable items.</p>
<p>This function was introduced in Qt 4.3.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#transform">transform</a>(), <a href="qgraphicsitem.html#setTransform">setTransform</a>(), <a href="qgraphicsitem.html#scenePos">scenePos</a>(), <a href="graphicsview.html#the-graphics-view-coordinate-system">The
Graphics View Coordinate System</a>, and <a href="qgraphicsitem.html#itemTransform">itemTransform</a>().</p>


<h3 class="fn"><a name="dragEnterEvent" />QGraphicsItem.dragEnterEvent (<i>self</i>, <a href="qgraphicsscenedragdropevent.html">QGraphicsSceneDragDropEvent</a>&#160;<i>event</i>)</h3><p>This event handler, for event <i>event</i>, can be reimplemented
to receive drag enter events for this item. Drag enter events are
generated as the cursor enters the item's area.</p>
<p>By accepting the event, (i.e., by calling <a href="qevent.html#accept">QEvent.accept</a>(),) the item will accept
drop events, in addition to receiving drag move and drag leave.
Otherwise, the event will be ignored and propagate to the item
beneath. If the event is accepted, the item will receive a drag
move event before control goes back to the event loop.</p>
<p>A common implementation of dragEnterEvent accepts or ignores
<i>event</i> depending on the associated mime data in <i>event</i>.
Example:</p>
<pre class="cpp">
 CustomItem<span class="operator">.</span>CustomItem()
 {
     setAcceptDrops(<span class="keyword">true</span>);
     <span class="operator">.</span><span class="operator">.</span><span class="operator">.</span>
 }

 <span class="type">void</span> CustomItem<span class="operator">.</span>dragEnterEvent(<span class="type"><a href="qgraphicsscenedragdropevent.html">QGraphicsSceneDragDropEvent</a></span> <span class="operator">*</span>event)
 {
     event<span class="operator">-</span><span class="operator">&gt;</span>setAccepted(event<span class="operator">-</span><span class="operator">&gt;</span>mimeData()<span class="operator">-</span><span class="operator">&gt;</span>hasFormat(<span class="string">"text/plain"</span>));
 }
</pre>
<p>Items do not receive drag and drop events by default; to enable
this feature, call <tt>setAcceptDrops(true)</tt>.</p>
<p>The default implementation does nothing.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#dropEvent">dropEvent</a>(), <a href="qgraphicsitem.html#dragMoveEvent">dragMoveEvent</a>(), and
<a href="qgraphicsitem.html#dragLeaveEvent">dragLeaveEvent</a>().</p>


<h3 class="fn"><a name="dragLeaveEvent" />QGraphicsItem.dragLeaveEvent (<i>self</i>, <a href="qgraphicsscenedragdropevent.html">QGraphicsSceneDragDropEvent</a>&#160;<i>event</i>)</h3><p>This event handler, for event <i>event</i>, can be reimplemented
to receive drag leave events for this item. Drag leave events are
generated as the cursor leaves the item's area. Most often you will
not need to reimplement this function, but it can be useful for
resetting state in your item (e.g., highlighting).</p>
<p>Calling <a href="qevent.html#ignore">QEvent.ignore</a>() or
<a href="qevent.html#accept">QEvent.accept</a>() on <i>event</i>
has no effect.</p>
<p>Items do not receive drag and drop events by default; to enable
this feature, call <tt>setAcceptDrops(true)</tt>.</p>
<p>The default implementation does nothing.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#dragEnterEvent">dragEnterEvent</a>(), <a href="qgraphicsitem.html#dropEvent">dropEvent</a>(), and <a href="qgraphicsitem.html#dragMoveEvent">dragMoveEvent</a>().</p>


<h3 class="fn"><a name="dragMoveEvent" />QGraphicsItem.dragMoveEvent (<i>self</i>, <a href="qgraphicsscenedragdropevent.html">QGraphicsSceneDragDropEvent</a>&#160;<i>event</i>)</h3><p>This event handler, for event <i>event</i>, can be reimplemented
to receive drag move events for this item. Drag move events are
generated as the cursor moves around inside the item's area. Most
often you will not need to reimplement this function; it is used to
indicate that only parts of the item can accept drops.</p>
<p>Calling <a href="qevent.html#ignore">QEvent.ignore</a>() or
<a href="qevent.html#accept">QEvent.accept</a>() on <i>event</i>
toggles whether or not the item will accept drops at the position
from the event. By default, <i>event</i> is accepted, indicating
that the item allows drops at the specified position.</p>
<p>Items do not receive drag and drop events by default; to enable
this feature, call <tt>setAcceptDrops(true)</tt>.</p>
<p>The default implementation does nothing.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#dropEvent">dropEvent</a>(), <a href="qgraphicsitem.html#dragEnterEvent">dragEnterEvent</a>(), and
<a href="qgraphicsitem.html#dragLeaveEvent">dragLeaveEvent</a>().</p>


<h3 class="fn"><a name="dropEvent" />QGraphicsItem.dropEvent (<i>self</i>, <a href="qgraphicsscenedragdropevent.html">QGraphicsSceneDragDropEvent</a>&#160;<i>event</i>)</h3><p>This event handler, for event <i>event</i>, can be reimplemented
to receive drop events for this item. Items can only receive drop
events if the last drag move event was accepted.</p>
<p>Calling <a href="qevent.html#ignore">QEvent.ignore</a>() or
<a href="qevent.html#accept">QEvent.accept</a>() on <i>event</i>
has no effect.</p>
<p>Items do not receive drag and drop events by default; to enable
this feature, call <tt>setAcceptDrops(true)</tt>.</p>
<p>The default implementation does nothing.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#dragEnterEvent">dragEnterEvent</a>(), <a href="qgraphicsitem.html#dragMoveEvent">dragMoveEvent</a>(), and
<a href="qgraphicsitem.html#dragLeaveEvent">dragLeaveEvent</a>().</p>


<h3 class="fn"><a name="effectiveOpacity" />float QGraphicsItem.effectiveOpacity (<i>self</i>)</h3><p>Returns this item's <i>effective</i> opacity, which is between
0.0 (transparent) and 1.0 (opaque). This value is a combination of
this item's local opacity, and its parent and ancestors' opacities.
The effective opacity decides how the item is rendered.</p>
<p>This function was introduced in Qt 4.5.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#opacity">opacity</a>(), <a href="qgraphicsitem.html#setOpacity">setOpacity</a>(), <a href="qgraphicsitem.html#paint">paint</a>(), <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemIgnoresParentOpacity</a>,
and <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemDoesntPropagateOpacityToChildren</a>.</p>


<h3 class="fn"><a name="ensureVisible" />QGraphicsItem.ensureVisible (<i>self</i>, <a href="qrectf.html">QRectF</a>&#160;<i>rect</i>&#160;=&#160;QRectF(), int&#160;<i>xMargin</i>&#160;=&#160;50, int&#160;<i>yMargin</i>&#160;=&#160;50)</h3><p>If this item is part of a scene that is viewed by a <a href="qgraphicsview.html">QGraphicsView</a>, this convenience function
will attempt to scroll the view to ensure that <i>rect</i> is
visible inside the view's viewport. If <i>rect</i> is a null rect
(the default), <a href="qgraphicsitem.html">QGraphicsItem</a> will
default to the item's bounding rect. <i>xmargin</i> and
<i>ymargin</i> are the number of pixels the view should use for
margins.</p>
<p>If the specified rect cannot be reached, the contents are
scrolled to the nearest valid position.</p>
<p>If this item is not viewed by a <a href="qgraphicsview.html">QGraphicsView</a>, this function does
nothing.</p>
<p><b>See also</b> <a href="qgraphicsview.html#ensureVisible">QGraphicsView.ensureVisible</a>().</p>


<h3 class="fn"><a name="ensureVisible-2" />QGraphicsItem.ensureVisible (<i>self</i>, float&#160;<i>x</i>, float&#160;<i>y</i>, float&#160;<i>w</i>, float&#160;<i>h</i>, int&#160;<i>xMargin</i>&#160;=&#160;50, int&#160;<i>yMargin</i>&#160;=&#160;50)</h3><p>This convenience function is equivalent to calling
ensureVisible(<a href="qrectf.html">QRectF</a>(<i>x</i>, <i>y</i>,
<i>w</i>, <i>h</i>), <i>xmargin</i>, <i>ymargin</i>):</p>


<h3 class="fn"><a name="filtersChildEvents" />bool QGraphicsItem.filtersChildEvents (<i>self</i>)</h3><p>Returns true if this item filters child events (i.e., all events
intended for any of its children are instead sent to this item);
otherwise, false is returned.</p>
<p>The default value is false; child events are not filtered.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#setFiltersChildEvents">setFiltersChildEvents</a>().</p>


<h3 class="fn"><a name="flags" /><a href="qgraphicsitem-graphicsitemflags.html">GraphicsItemFlags</a> QGraphicsItem.flags (<i>self</i>)</h3><p>Returns this item's flags. The flags describe what configurable
features of the item are enabled and not. For example, if the flags
include <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemIsFocusable</a>, the
item can accept input focus.</p>
<p>By default, no flags are enabled.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#setFlags">setFlags</a>() and <a href="qgraphicsitem.html#setFlag">setFlag</a>().</p>


<h3 class="fn"><a name="focusInEvent" />QGraphicsItem.focusInEvent (<i>self</i>, <a href="qfocusevent.html">QFocusEvent</a>&#160;<i>event</i>)</h3><p>This event handler, for event <i>event</i>, can be reimplemented
to receive focus in events for this item. The default
implementation calls <a href="qgraphicsitem.html#ensureVisible">ensureVisible</a>().</p>
<p><b>See also</b> <a href="qgraphicsitem.html#focusOutEvent">focusOutEvent</a>(), <a href="qgraphicsitem.html#sceneEvent">sceneEvent</a>(), and <a href="qgraphicsitem.html#setFocus">setFocus</a>().</p>


<h3 class="fn"><a name="focusItem" /><a href="qgraphicsitem.html">QGraphicsItem</a> QGraphicsItem.focusItem (<i>self</i>)</h3><p>If this item, a child or descendant of this item currently has
input focus, this function will return a pointer to that item. If
no descendant has input focus, 0 is returned.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#hasFocus">hasFocus</a>(), <a href="qgraphicsitem.html#setFocus">setFocus</a>(), and <a href="qwidget.html#focusWidget">QWidget.focusWidget</a>().</p>


<h3 class="fn"><a name="focusOutEvent" />QGraphicsItem.focusOutEvent (<i>self</i>, <a href="qfocusevent.html">QFocusEvent</a>&#160;<i>event</i>)</h3><p>This event handler, for event <i>event</i>, can be reimplemented
to receive focus out events for this item. The default
implementation does nothing.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#focusInEvent">focusInEvent</a>(), <a href="qgraphicsitem.html#sceneEvent">sceneEvent</a>(), and <a href="qgraphicsitem.html#setFocus">setFocus</a>().</p>


<h3 class="fn"><a name="focusProxy" /><a href="qgraphicsitem.html">QGraphicsItem</a> QGraphicsItem.focusProxy (<i>self</i>)</h3><p>Returns this item's focus proxy, or 0 if this item has no focus
proxy.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#setFocusProxy">setFocusProxy</a>(), <a href="qgraphicsitem.html#setFocus">setFocus</a>(), and <a href="qgraphicsitem.html#hasFocus">hasFocus</a>().</p>


<h3 class="fn"><a name="grabKeyboard" />QGraphicsItem.grabKeyboard (<i>self</i>)</h3><p>Grabs the keyboard input.</p>
<p>The item will receive all keyboard input to the scene until one
of the following events occur:</p>
<ul>
<li>The item becomes invisible</li>
<li>The item is removed from the scene</li>
<li>The item is deleted</li>
<li>The item calls <a href="qgraphicsitem.html#ungrabKeyboard">ungrabKeyboard</a>()</li>
<li>Another item calls grabKeyboard(); the item will regain the
keyboard grab when the other item calls <a href="qgraphicsitem.html#ungrabKeyboard">ungrabKeyboard</a>().</li>
</ul>
<p>When an item gains the keyboard grab, it receives a <a href="qevent.html#Type-enum">QEvent.GrabKeyboard</a> event. When it
loses the keyboard grab, it receives a <a href="qevent.html#Type-enum">QEvent.UngrabKeyboard</a> event. These
events can be used to detect when your item gains or loses the
keyboard grab through other means than gaining input focus.</p>
<p>It is almost never necessary to explicitly grab the keyboard in
Qt, as Qt grabs and releases it sensibly. In particular, Qt grabs
the keyboard when your item gains input focus, and releases it when
your item loses input focus, or when the item is hidden.</p>
<p>Note that only visible items can grab keyboard input. Calling
grabKeyboard() on an invisible item has no effect.</p>
<p>Keyboard events are not affected.</p>
<p>This function was introduced in Qt 4.4.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#ungrabKeyboard">ungrabKeyboard</a>(), <a href="qgraphicsitem.html#grabMouse">grabMouse</a>(), and <a href="qgraphicsitem.html#setFocus">setFocus</a>().</p>


<h3 class="fn"><a name="grabMouse" />QGraphicsItem.grabMouse (<i>self</i>)</h3><p>Grabs the mouse input.</p>
<p>This item will receive all mouse events for the scene until any
of the following events occurs:</p>
<ul>
<li>The item becomes invisible</li>
<li>The item is removed from the scene</li>
<li>The item is deleted</li>
<li>The item call <a href="qgraphicsitem.html#ungrabMouse">ungrabMouse</a>()</li>
<li>Another item calls grabMouse(); the item will regain the mouse
grab when the other item calls <a href="qgraphicsitem.html#ungrabMouse">ungrabMouse</a>().</li>
</ul>
<p>When an item gains the mouse grab, it receives a <a href="qevent.html#Type-enum">QEvent.GrabMouse</a> event. When it loses
the mouse grab, it receives a <a href="qevent.html#Type-enum">QEvent.UngrabMouse</a> event. These events
can be used to detect when your item gains or loses the mouse grab
through other means than receiving mouse button events.</p>
<p>It is almost never necessary to explicitly grab the mouse in Qt,
as Qt grabs and releases it sensibly. In particular, Qt grabs the
mouse when you press a mouse button, and keeps the mouse grabbed
until you release the last mouse button. Also, <a href="qt.html#WindowType-enum">Qt.Popup</a> widgets implicitly call
grabMouse() when shown, and <a href="qgraphicsitem.html#ungrabMouse">ungrabMouse</a>() when hidden.</p>
<p>Note that only visible items can grab mouse input. Calling
grabMouse() on an invisible item has no effect.</p>
<p>Keyboard events are not affected.</p>
<p>This function was introduced in Qt 4.4.</p>
<p><b>See also</b> <a href="qgraphicsscene.html#mouseGrabberItem">QGraphicsScene.mouseGrabberItem</a>(),
<a href="qgraphicsitem.html#ungrabMouse">ungrabMouse</a>(), and
<a href="qgraphicsitem.html#grabKeyboard">grabKeyboard</a>().</p>


<h3 class="fn"><a name="graphicsEffect" /><a href="qgraphicseffect.html">QGraphicsEffect</a> QGraphicsItem.graphicsEffect (<i>self</i>)</h3><p>Returns a pointer to this item's effect if it has one; otherwise
0.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#setGraphicsEffect">setGraphicsEffect</a>().</p>


<h3 class="fn"><a name="group" /><a href="qgraphicsitemgroup.html">QGraphicsItemGroup</a> QGraphicsItem.group (<i>self</i>)</h3><p>Returns a pointer to this item's item group, or 0 if this item
is not member of a group.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#setGroup">setGroup</a>(), <a href="qgraphicsitemgroup.html">QGraphicsItemGroup</a>, and <a href="qgraphicsscene.html#createItemGroup">QGraphicsScene.createItemGroup</a>().</p>


<h3 class="fn"><a name="handlesChildEvents" />bool QGraphicsItem.handlesChildEvents (<i>self</i>)</h3><h3 class="fn"><a name="hasCursor" />bool QGraphicsItem.hasCursor (<i>self</i>)</h3><p>Returns true if this item has a cursor set; otherwise, false is
returned.</p>
<p>By default, items don't have any cursor set. <a href="qgraphicsitem.html#cursor">cursor</a>() will return a standard
pointing arrow cursor.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#unsetCursor">unsetCursor</a>().</p>


<h3 class="fn"><a name="hasFocus" />bool QGraphicsItem.hasFocus (<i>self</i>)</h3><p>Returns true if this item is active, and it or its <a href="qgraphicsitem.html#focusProxy">focus proxy</a> has keyboard input
focus; otherwise, returns false.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#focusItem">focusItem</a>(), <a href="qgraphicsitem.html#setFocus">setFocus</a>(), <a href="qgraphicsscene.html#setFocusItem">QGraphicsScene.setFocusItem</a>(),
and <a href="qgraphicsitem.html#isActive">isActive</a>().</p>


<h3 class="fn"><a name="hide" />QGraphicsItem.hide (<i>self</i>)</h3><p>Hides the item. (Items are visible by default.)</p>
<p>This convenience function is equivalent to calling
<tt>setVisible(false)</tt>.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#show">show</a>() and
<a href="qgraphicsitem.html#setVisible">setVisible</a>().</p>


<h3 class="fn"><a name="hoverEnterEvent" />QGraphicsItem.hoverEnterEvent (<i>self</i>, <a href="qgraphicsscenehoverevent.html">QGraphicsSceneHoverEvent</a>&#160;<i>event</i>)</h3><p>This event handler, for event <i>event</i>, can be reimplemented
to receive hover enter events for this item. The default
implementation calls <a href="qgraphicsitem.html#update">update</a>(); otherwise it does
nothing.</p>
<p>Calling <a href="qevent.html#ignore">QEvent.ignore</a>() or
<a href="qevent.html#accept">QEvent.accept</a>() on <i>event</i>
has no effect.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#hoverMoveEvent">hoverMoveEvent</a>(), <a href="qgraphicsitem.html#hoverLeaveEvent">hoverLeaveEvent</a>(),
<a href="qgraphicsitem.html#sceneEvent">sceneEvent</a>(), and
<a href="qgraphicsitem.html#setAcceptHoverEvents">setAcceptHoverEvents</a>().</p>


<h3 class="fn"><a name="hoverLeaveEvent" />QGraphicsItem.hoverLeaveEvent (<i>self</i>, <a href="qgraphicsscenehoverevent.html">QGraphicsSceneHoverEvent</a>&#160;<i>event</i>)</h3><p>This event handler, for event <i>event</i>, can be reimplemented
to receive hover leave events for this item. The default
implementation calls <a href="qgraphicsitem.html#update">update</a>(); otherwise it does
nothing.</p>
<p>Calling <a href="qevent.html#ignore">QEvent.ignore</a>() or
<a href="qevent.html#accept">QEvent.accept</a>() on <i>event</i>
has no effect.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#hoverEnterEvent">hoverEnterEvent</a>(),
<a href="qgraphicsitem.html#hoverMoveEvent">hoverMoveEvent</a>(),
<a href="qgraphicsitem.html#sceneEvent">sceneEvent</a>(), and
<a href="qgraphicsitem.html#setAcceptHoverEvents">setAcceptHoverEvents</a>().</p>


<h3 class="fn"><a name="hoverMoveEvent" />QGraphicsItem.hoverMoveEvent (<i>self</i>, <a href="qgraphicsscenehoverevent.html">QGraphicsSceneHoverEvent</a>&#160;<i>event</i>)</h3><p>This event handler, for event <i>event</i>, can be reimplemented
to receive hover move events for this item. The default
implementation does nothing.</p>
<p>Calling <a href="qevent.html#ignore">QEvent.ignore</a>() or
<a href="qevent.html#accept">QEvent.accept</a>() on <i>event</i>
has no effect.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#hoverEnterEvent">hoverEnterEvent</a>(),
<a href="qgraphicsitem.html#hoverLeaveEvent">hoverLeaveEvent</a>(),
<a href="qgraphicsitem.html#sceneEvent">sceneEvent</a>(), and
<a href="qgraphicsitem.html#setAcceptHoverEvents">setAcceptHoverEvents</a>().</p>


<h3 class="fn"><a name="inputMethodEvent" />QGraphicsItem.inputMethodEvent (<i>self</i>, <a href="qinputmethodevent.html">QInputMethodEvent</a>&#160;<i>event</i>)</h3><p>This event handler, for event <i>event</i>, can be reimplemented
to receive input method events for this item. The default
implementation ignores the event.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#inputMethodQuery">inputMethodQuery</a>() and
<a href="qgraphicsitem.html#sceneEvent">sceneEvent</a>().</p>


<h3 class="fn"><a name="inputMethodHints" /><a href="qt-inputmethodhints.html">Qt.InputMethodHints</a> QGraphicsItem.inputMethodHints (<i>self</i>)</h3><p>Returns the current input method hints of this item.</p>
<p>Input method hints are only relevant for input items. The hints
are used by the input method to indicate how it should operate. For
example, if the Qt.ImhNumbersOnly flag is set, the input method
may change its visual components to reflect that only numbers can
be entered.</p>
<p>The effect may vary between input method implementations.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#setInputMethodHints">setInputMethodHints</a>(),
<a href="qgraphicsitem.html#inputMethodQuery">inputMethodQuery</a>(), and
<a href="qinputcontext.html">QInputContext</a>.</p>


<h3 class="fn"><a name="inputMethodQuery" />QVariant QGraphicsItem.inputMethodQuery (<i>self</i>, <a href="qt.html#InputMethodQuery-enum">Qt.InputMethodQuery</a>&#160;<i>query</i>)</h3><p>This method is only relevant for input items. It is used by the
input method to query a set of properties of the item to be able to
support complex input method operations, such as support for
surrounding text and reconversions. <i>query</i> specifies which
property is queried.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#inputMethodEvent">inputMethodEvent</a>(),
<a href="qinputmethodevent.html">QInputMethodEvent</a>, and
<a href="qinputcontext.html">QInputContext</a>.</p>


<h3 class="fn"><a name="installSceneEventFilter" />QGraphicsItem.installSceneEventFilter (<i>self</i>, <a href="qgraphicsitem.html">QGraphicsItem</a>&#160;<i>filterItem</i>)</h3><p>Installs an event filter for this item on <i>filterItem</i>,
causing all events for this item to first pass through
<i>filterItem</i>'s <a href="qgraphicsitem.html#sceneEventFilter">sceneEventFilter</a>()
function.</p>
<p>To filter another item's events, install this item as an event
filter for the other item. Example:</p>
<pre class="cpp">
 <span class="type"><a href="qgraphicsscene.html">QGraphicsScene</a></span> scene;
 <span class="type"><a href="qgraphicsellipseitem.html">QGraphicsEllipseItem</a></span> <span class="operator">*</span>ellipse <span class="operator">=</span> scene<span class="operator">.</span>addEllipse(<span class="type"><a href="qrectf.html">QRectF</a></span>(<span class="operator">-</span><span class="number">10</span><span class="operator">,</span> <span class="operator">-</span><span class="number">10</span><span class="operator">,</span> <span class="number">20</span><span class="operator">,</span> <span class="number">20</span>));
 <span class="type"><a href="qgraphicslineitem.html">QGraphicsLineItem</a></span> <span class="operator">*</span>line <span class="operator">=</span> scene<span class="operator">.</span>addLine(<span class="type"><a href="qlinef.html">QLineF</a></span>(<span class="operator">-</span><span class="number">10</span><span class="operator">,</span> <span class="operator">-</span><span class="number">10</span><span class="operator">,</span> <span class="number">20</span><span class="operator">,</span> <span class="number">20</span>));

 line<span class="operator">-</span><span class="operator">&gt;</span>installSceneEventFilter(ellipse);
 <span class="comment">// line's events are filtered by ellipse's sceneEventFilter() function.</span>

 ellipse<span class="operator">-</span><span class="operator">&gt;</span>installSceneEventFilter(line);
 <span class="comment">// ellipse's events are filtered by line's sceneEventFilter() function.</span>
</pre>
<p>An item can only filter events for other items in the same
scene. Also, an item cannot filter its own events; instead, you can
reimplement <a href="qgraphicsitem.html#sceneEvent">sceneEvent</a>() directly.</p>
<p>Items must belong to a scene for scene event filters to be
installed and used.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#removeSceneEventFilter">removeSceneEventFilter</a>(),
<a href="qgraphicsitem.html#sceneEventFilter">sceneEventFilter</a>(), and
<a href="qgraphicsitem.html#sceneEvent">sceneEvent</a>().</p>


<h3 class="fn"><a name="isActive" />bool QGraphicsItem.isActive (<i>self</i>)</h3><p>Returns true if this item is active; otherwise returns
false.</p>
<p>An item can only be active if the scene is active. An item is
active if it is, or is a descendent of, an active panel. Items in
non-active panels are not active.</p>
<p>Items that are not part of a panel follow scene activation when
the scene has no active panel.</p>
<p>Only active items can gain input focus.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also</b> <a href="qgraphicsscene.html#isActive">QGraphicsScene.isActive</a>(),
<a href="qgraphicsscene.html#activePanel">QGraphicsScene.activePanel</a>(),
<a href="qgraphicsitem.html#panel">panel</a>(), and <a href="qgraphicsitem.html#isPanel">isPanel</a>().</p>


<h3 class="fn"><a name="isAncestorOf" />bool QGraphicsItem.isAncestorOf (<i>self</i>, <a href="qgraphicsitem.html">QGraphicsItem</a>&#160;<i>child</i>)</h3><p>Returns true if this item is an ancestor of <i>child</i> (i.e.,
if this item is <i>child</i>'s parent, or one of <i>child</i>'s
parent's ancestors).</p>
<p><b>See also</b> <a href="qgraphicsitem.html#parentItem">parentItem</a>().</p>


<h3 class="fn"><a name="isBlockedByModalPanel" />(bool, <a href="qgraphicsitem.html">QGraphicsItem</a>&#160;<i>blockingPanel</i>) QGraphicsItem.isBlockedByModalPanel (<i>self</i>)</h3><p>Returns true if this item is blocked by a modal panel, false
otherwise. If <i>blockingPanel</i> is non-zero,
<i>blockingPanel</i> will be set to the modal panel that is
blocking this item. If this item is not blocked,
<i>blockingPanel</i> will not be set by this function.</p>
<p>This function always returns false for items not in a scene.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#panelModality">panelModality</a>(), <a href="qgraphicsitem.html#setPanelModality">setPanelModality</a>(), and
<a href="qgraphicsitem.html#PanelModality-enum">PanelModality</a>.</p>


<h3 class="fn"><a name="isClipped" />bool QGraphicsItem.isClipped (<i>self</i>)</h3><p>Returns true if this item is clipped. An item is clipped if it
has either set the <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemClipsToShape</a>
flag, or if it or any of its ancestors has set the <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemClipsChildrenToShape</a>
flag.</p>
<p>Clipping affects the item's appearance (i.e., painting), as well
as mouse and hover event delivery.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#clipPath">clipPath</a>(), <a href="qgraphicsitem.html#shape">shape</a>(), and <a href="qgraphicsitem.html#setFlags">setFlags</a>().</p>


<h3 class="fn"><a name="isEnabled" />bool QGraphicsItem.isEnabled (<i>self</i>)</h3><p>Returns true if the item is enabled; otherwise, false is
returned.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#setEnabled">setEnabled</a>().</p>


<h3 class="fn"><a name="isObscured" />bool QGraphicsItem.isObscured (<i>self</i>)</h3><p>Returns true if this item's bounding rect is completely obscured
by the opaque shape of any of colliding items above it (i.e., with
a higher Z value than this item).</p>
<p>Its implementation is based on calling <a href="qgraphicsitem.html#isObscuredBy">isObscuredBy</a>(), which you can
reimplement to provide a custom obscurity algorithm.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#opaqueArea">opaqueArea</a>().</p>


<h3 class="fn"><a name="isObscured-2" />bool QGraphicsItem.isObscured (<i>self</i>, <a href="qrectf.html">QRectF</a>&#160;<i>rect</i>)</h3><p>This convenience function is equivalent to calling
isObscured(<a href="qrectf.html">QRectF</a>(<i>x</i>, <i>y</i>,
<i>w</i>, <i>h</i>)).</p>
<p>This function was introduced in Qt 4.3.</p>


<h3 class="fn"><a name="isObscured-3" />bool QGraphicsItem.isObscured (<i>self</i>, float&#160;<i>ax</i>, float&#160;<i>ay</i>, float&#160;<i>w</i>, float&#160;<i>h</i>)</h3><p>This is an overloaded function.</p>
<p>Returns true if <i>rect</i> is completely obscured by the opaque
shape of any of colliding items above it (i.e., with a higher Z
value than this item).</p>
<p>Unlike the default <a href="qgraphicsitem.html#isObscured">isObscured</a>() function, this
function does not call <a href="qgraphicsitem.html#isObscuredBy">isObscuredBy</a>().</p>
<p>This function was introduced in Qt 4.3.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#opaqueArea">opaqueArea</a>().</p>


<h3 class="fn"><a name="isObscuredBy" />bool QGraphicsItem.isObscuredBy (<i>self</i>, <a href="qgraphicsitem.html">QGraphicsItem</a>&#160;<i>item</i>)</h3><p>Returns true if this item's bounding rect is completely obscured
by the opaque shape of <i>item</i>.</p>
<p>The base implementation maps <i>item</i>'s <a href="qgraphicsitem.html#opaqueArea">opaqueArea</a>() to this item's
coordinate system, and then checks if this item's <a href="qgraphicsitem.html#boundingRect">boundingRect</a>() is fully
contained within the mapped shape.</p>
<p>You can reimplement this function to provide a custom algorithm
for determining whether this item is obscured by <i>item</i>.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#opaqueArea">opaqueArea</a>() and <a href="qgraphicsitem.html#isObscured">isObscured</a>().</p>


<h3 class="fn"><a name="isPanel" />bool QGraphicsItem.isPanel (<i>self</i>)</h3><p>Returns true if the item is a panel; otherwise returns
false.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#panel">QGraphicsItem.panel</a>() and <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemIsPanel</a>.</p>


<h3 class="fn"><a name="isSelected" />bool QGraphicsItem.isSelected (<i>self</i>)</h3><p>Returns true if this item is selected; otherwise, false is
returned.</p>
<p>Items that are in a group inherit the group's selected
state.</p>
<p>Items are not selected by default.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#setSelected">setSelected</a>() and <a href="qgraphicsscene.html#setSelectionArea">QGraphicsScene.setSelectionArea</a>().</p>


<h3 class="fn"><a name="isUnderMouse" />bool QGraphicsItem.isUnderMouse (<i>self</i>)</h3><p>Returns true if this item is currently under the mouse cursor in
one of the views; otherwise, false is returned.</p>
<p>This function was introduced in Qt 4,4.</p>
<p><b>See also</b> <a href="qgraphicsscene.html#views">QGraphicsScene.views</a>() and
<a href="qcursor.html#pos">QCursor.pos</a>().</p>


<h3 class="fn"><a name="isVisible" />bool QGraphicsItem.isVisible (<i>self</i>)</h3><p>Returns true if the item is visible; otherwise, false is
returned.</p>
<p>Note that the item's general visibility is unrelated to whether
or not it is actually being visualized by a <a href="qgraphicsview.html">QGraphicsView</a>.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#setVisible">setVisible</a>().</p>


<h3 class="fn"><a name="isVisibleTo" />bool QGraphicsItem.isVisibleTo (<i>self</i>, <a href="qgraphicsitem.html">QGraphicsItem</a>&#160;<i>parent</i>)</h3><p>Returns true if the item is visible to <i>parent</i>; otherwise,
false is returned. <i>parent</i> can be 0, in which case this
function will return whether the item is visible to the scene or
not.</p>
<p>An item may not be visible to its ancestors even if <a href="qgraphicsitem.html#isVisible">isVisible</a>() is true. It may also
be visible to its ancestors even if <a href="qgraphicsitem.html#isVisible">isVisible</a>() is false. If any
ancestor is hidden, the item itself will be implicitly hidden, in
which case this function will return false.</p>
<p>This function was introduced in Qt 4.4.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#isVisible">isVisible</a>() and <a href="qgraphicsitem.html#setVisible">setVisible</a>().</p>


<h3 class="fn"><a name="isWidget" />bool QGraphicsItem.isWidget (<i>self</i>)</h3><p>Returns true if this item is a widget (i.e., <a href="qgraphicswidget.html">QGraphicsWidget</a>); otherwise, returns
false.</p>
<p>This function was introduced in Qt 4.4.</p>


<h3 class="fn"><a name="isWindow" />bool QGraphicsItem.isWindow (<i>self</i>)</h3><p>Returns true if the item is a <a href="qgraphicswidget.html">QGraphicsWidget</a> window, otherwise
returns false.</p>
<p>This function was introduced in Qt 4.4.</p>
<p><b>See also</b> <a href="qgraphicswidget.html#windowFlags-prop">QGraphicsWidget.windowFlags</a>().</p>


<h3 class="fn"><a name="itemChange" />QVariant QGraphicsItem.itemChange (<i>self</i>, <a href="qgraphicsitem.html#GraphicsItemChange-enum">GraphicsItemChange</a>&#160;<i>change</i>, QVariant&#160;<i>value</i>)</h3><p>This virtual function is called by <a href="qgraphicsitem.html">QGraphicsItem</a> to notify custom items that
some part of the item's state changes. By reimplementing this
function, your can react to a change, and in some cases, (depending
on <i>change</i>,) adjustments can be made.</p>
<p><i>change</i> is the parameter of the item that is changing.
<i>value</i> is the new value; the type of the value depends on
<i>change</i>.</p>
<p>Example:</p>
<pre class="cpp">
 <span class="type"><a href="qvariant.html">QVariant</a></span> Component<span class="operator">.</span>itemChange(GraphicsItemChange change<span class="operator">,</span> <span class="keyword">const</span> <span class="type"><a href="qvariant.html">QVariant</a></span> <span class="operator">&amp;</span>value)
 {
     <span class="keyword">if</span> (change <span class="operator">=</span><span class="operator">=</span> ItemPositionChange <span class="operator">&amp;</span><span class="operator">&amp;</span> scene()) {
         <span class="comment">// value is the new position.</span>
         <span class="type"><a href="qpointf.html">QPointF</a></span> newPos <span class="operator">=</span> value<span class="operator">.</span>toPointF();
         <span class="type"><a href="qrectf.html">QRectF</a></span> rect <span class="operator">=</span> scene()<span class="operator">-</span><span class="operator">&gt;</span>sceneRect();
         <span class="keyword">if</span> (<span class="operator">!</span>rect<span class="operator">.</span>contains(newPos)) {
             <span class="comment">// Keep the item inside the scene rect.</span>
             newPos<span class="operator">.</span>setX(<a href="qtcore.html#qMin">qMin</a>(rect<span class="operator">.</span>right()<span class="operator">,</span> <a href="qtcore.html#qMax">qMax</a>(newPos<span class="operator">.</span>x()<span class="operator">,</span> rect<span class="operator">.</span>left())));
             newPos<span class="operator">.</span>setY(<a href="qtcore.html#qMin">qMin</a>(rect<span class="operator">.</span>bottom()<span class="operator">,</span> <a href="qtcore.html#qMax">qMax</a>(newPos<span class="operator">.</span>y()<span class="operator">,</span> rect<span class="operator">.</span>top())));
             <span class="keyword">return</span> newPos;
         }
     }
     <span class="keyword">return</span> <span class="type"><a href="qgraphicsitem.html">QGraphicsItem</a></span><span class="operator">.</span>itemChange(change<span class="operator">,</span> value);
 }
</pre>
<p>The default implementation does nothing, and returns
<i>value</i>.</p>
<p>Note: Certain <a href="qgraphicsitem.html">QGraphicsItem</a>
functions cannot be called in a reimplementation of this function;
see the <a href="qgraphicsitem.html#GraphicsItemChange-enum">GraphicsItemChange</a>
documentation for details.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#GraphicsItemChange-enum">GraphicsItemChange</a>.</p>


<h3 class="fn"><a name="itemTransform" />(<a href="qtransform.html">QTransform</a>, bool&#160;<i>ok</i>) QGraphicsItem.itemTransform (<i>self</i>, <a href="qgraphicsitem.html">QGraphicsItem</a>&#160;<i>other</i>)</h3><p>Returns a <a href="qtransform.html">QTransform</a> that maps
coordinates from this item to <i>other</i>. If <i>ok</i> is not
null, and if there is no such transform, the boolean pointed to by
<i>ok</i> will be set to false; otherwise it will be set to
true.</p>
<p>This transform provides an alternative to the <a href="qgraphicsitem.html#mapToItem">mapToItem</a>() or <a href="qgraphicsitem.html#mapFromItem">mapFromItem</a>() functions, by
returning the appropriate transform so that you can map shapes and
coordinates yourself. It also helps you write more efficient code
when repeatedly mapping between the same two items.</p>
<p><b>Note:</b> In rare circumstances, there is no transform that
maps between two items.</p>
<p>This function was introduced in Qt 4.5.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#mapToItem">mapToItem</a>(), <a href="qgraphicsitem.html#mapFromItem">mapFromItem</a>(), and <a href="qgraphicsitem.html#deviceTransform">deviceTransform</a>().</p>


<h3 class="fn"><a name="keyPressEvent" />QGraphicsItem.keyPressEvent (<i>self</i>, <a href="qkeyevent.html">QKeyEvent</a>&#160;<i>event</i>)</h3><p>This event handler, for event <i>event</i>, can be reimplemented
to receive key press events for this item. The default
implementation ignores the event. If you reimplement this handler,
the event will by default be accepted.</p>
<p>Note that key events are only received for items that set the
<a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemIsFocusable</a>
flag, and that have keyboard input focus.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#keyReleaseEvent">keyReleaseEvent</a>(),
<a href="qgraphicsitem.html#setFocus">setFocus</a>(), <a href="qgraphicsscene.html#setFocusItem">QGraphicsScene.setFocusItem</a>(),
and <a href="qgraphicsitem.html#sceneEvent">sceneEvent</a>().</p>


<h3 class="fn"><a name="keyReleaseEvent" />QGraphicsItem.keyReleaseEvent (<i>self</i>, <a href="qkeyevent.html">QKeyEvent</a>&#160;<i>event</i>)</h3><p>This event handler, for event <i>event</i>, can be reimplemented
to receive key release events for this item. The default
implementation ignores the event. If you reimplement this handler,
the event will by default be accepted.</p>
<p>Note that key events are only received for items that set the
<a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemIsFocusable</a>
flag, and that have keyboard input focus.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#keyPressEvent">keyPressEvent</a>(), <a href="qgraphicsitem.html#setFocus">setFocus</a>(), <a href="qgraphicsscene.html#setFocusItem">QGraphicsScene.setFocusItem</a>(),
and <a href="qgraphicsitem.html#sceneEvent">sceneEvent</a>().</p>


<h3 class="fn"><a name="mapFromItem" /><a href="qpointf.html">QPointF</a> QGraphicsItem.mapFromItem (<i>self</i>, <a href="qgraphicsitem.html">QGraphicsItem</a>&#160;<i>item</i>, <a href="qpointf.html">QPointF</a>&#160;<i>point</i>)</h3><p>Maps the point <i>point</i>, which is in <i>item</i>'s
coordinate system, to this item's coordinate system, and returns
the mapped coordinate.</p>
<p>If <i>item</i> is 0, this function returns the same as <a href="qgraphicsitem.html#mapFromScene">mapFromScene</a>().</p>
<p><b>See also</b> <a href="qgraphicsitem.html#itemTransform">itemTransform</a>(), <a href="qgraphicsitem.html#mapFromParent">mapFromParent</a>(), <a href="qgraphicsitem.html#mapFromScene">mapFromScene</a>(), <a href="qgraphicsitem.html#transform">transform</a>(), <a href="qgraphicsitem.html#mapToItem">mapToItem</a>(), and <a href="graphicsview.html#the-graphics-view-coordinate-system">The
Graphics View Coordinate System</a>.</p>


<h3 class="fn"><a name="mapFromItem-2" /><a href="qpolygonf.html">QPolygonF</a> QGraphicsItem.mapFromItem (<i>self</i>, <a href="qgraphicsitem.html">QGraphicsItem</a>&#160;<i>item</i>, <a href="qrectf.html">QRectF</a>&#160;<i>rect</i>)</h3><p>Maps the rectangle <i>rect</i>, which is in <i>item</i>'s
coordinate system, to this item's coordinate system, and returns
the mapped rectangle as a polygon.</p>
<p>If <i>item</i> is 0, this function returns the same as <a href="qgraphicsitem.html#mapFromScene">mapFromScene</a>()</p>
<p><b>See also</b> <a href="qgraphicsitem.html#itemTransform">itemTransform</a>(), <a href="qgraphicsitem.html#mapToItem">mapToItem</a>(), <a href="qgraphicsitem.html#mapFromParent">mapFromParent</a>(), <a href="qgraphicsitem.html#transform">transform</a>(), and <a href="graphicsview.html#the-graphics-view-coordinate-system">The
Graphics View Coordinate System</a>.</p>


<h3 class="fn"><a name="mapFromItem-3" /><a href="qpolygonf.html">QPolygonF</a> QGraphicsItem.mapFromItem (<i>self</i>, <a href="qgraphicsitem.html">QGraphicsItem</a>&#160;<i>item</i>, <a href="qpolygonf.html">QPolygonF</a>&#160;<i>polygon</i>)</h3><p>Maps the polygon <i>polygon</i>, which is in <i>item</i>'s
coordinate system, to this item's coordinate system, and returns
the mapped polygon.</p>
<p>If <i>item</i> is 0, this function returns the same as <a href="qgraphicsitem.html#mapFromScene">mapFromScene</a>().</p>
<p><b>See also</b> <a href="qgraphicsitem.html#itemTransform">itemTransform</a>(), <a href="qgraphicsitem.html#mapToItem">mapToItem</a>(), <a href="qgraphicsitem.html#mapFromParent">mapFromParent</a>(), <a href="qgraphicsitem.html#transform">transform</a>(), and <a href="graphicsview.html#the-graphics-view-coordinate-system">The
Graphics View Coordinate System</a>.</p>


<h3 class="fn"><a name="mapFromItem-4" /><a href="qpainterpath.html">QPainterPath</a> QGraphicsItem.mapFromItem (<i>self</i>, <a href="qgraphicsitem.html">QGraphicsItem</a>&#160;<i>item</i>, <a href="qpainterpath.html">QPainterPath</a>&#160;<i>path</i>)</h3><p>Maps the path <i>path</i>, which is in <i>item</i>'s coordinate
system, to this item's coordinate system, and returns the mapped
path.</p>
<p>If <i>item</i> is 0, this function returns the same as <a href="qgraphicsitem.html#mapFromScene">mapFromScene</a>().</p>
<p><b>See also</b> <a href="qgraphicsitem.html#itemTransform">itemTransform</a>(), <a href="qgraphicsitem.html#mapFromParent">mapFromParent</a>(), <a href="qgraphicsitem.html#mapFromScene">mapFromScene</a>(), <a href="qgraphicsitem.html#mapToItem">mapToItem</a>(), and <a href="graphicsview.html#the-graphics-view-coordinate-system">The
Graphics View Coordinate System</a>.</p>


<h3 class="fn"><a name="mapFromItem-5" /><a href="qpointf.html">QPointF</a> QGraphicsItem.mapFromItem (<i>self</i>, <a href="qgraphicsitem.html">QGraphicsItem</a>&#160;<i>item</i>, float&#160;<i>ax</i>, float&#160;<i>ay</i>)</h3><p>This convenience function is equivalent to calling
mapFromItem(item, <a href="qrectf.html">QRectF</a>(<i>x</i>,
<i>y</i>, <i>w</i>, <i>h</i>)).</p>
<p>This function was introduced in Qt 4.3.</p>


<h3 class="fn"><a name="mapFromItem-6" /><a href="qpolygonf.html">QPolygonF</a> QGraphicsItem.mapFromItem (<i>self</i>, <a href="qgraphicsitem.html">QGraphicsItem</a>&#160;<i>item</i>, float&#160;<i>ax</i>, float&#160;<i>ay</i>, float&#160;<i>w</i>, float&#160;<i>h</i>)</h3><p>This is an overloaded function.</p>
<p>This convenience function is equivalent to calling
mapFromItem(<i>item</i>, <a href="qpointf.html">QPointF</a>(<i>x</i>, <i>y</i>)).</p>


<h3 class="fn"><a name="mapFromParent" /><a href="qpointf.html">QPointF</a> QGraphicsItem.mapFromParent (<i>self</i>, <a href="qpointf.html">QPointF</a>&#160;<i>point</i>)</h3><p>Maps the point <i>point</i>, which is in this item's parent's
coordinate system, to this item's coordinate system, and returns
the mapped coordinate.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#mapFromItem">mapFromItem</a>(), <a href="qgraphicsitem.html#mapFromScene">mapFromScene</a>(), <a href="qgraphicsitem.html#transform">transform</a>(), <a href="qgraphicsitem.html#mapToParent">mapToParent</a>(), and <a href="graphicsview.html#the-graphics-view-coordinate-system">The
Graphics View Coordinate System</a>.</p>


<h3 class="fn"><a name="mapFromParent-2" /><a href="qpolygonf.html">QPolygonF</a> QGraphicsItem.mapFromParent (<i>self</i>, <a href="qrectf.html">QRectF</a>&#160;<i>rect</i>)</h3><p>Maps the rectangle <i>rect</i>, which is in this item's parent's
coordinate system, to this item's coordinate system, and returns
the mapped rectangle as a polygon.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#mapToParent">mapToParent</a>(), <a href="qgraphicsitem.html#mapFromItem">mapFromItem</a>(), <a href="qgraphicsitem.html#transform">transform</a>(), and <a href="graphicsview.html#the-graphics-view-coordinate-system">The
Graphics View Coordinate System</a>.</p>


<h3 class="fn"><a name="mapFromParent-3" /><a href="qpolygonf.html">QPolygonF</a> QGraphicsItem.mapFromParent (<i>self</i>, <a href="qpolygonf.html">QPolygonF</a>&#160;<i>polygon</i>)</h3><p>Maps the polygon <i>polygon</i>, which is in this item's
parent's coordinate system, to this item's coordinate system, and
returns the mapped polygon.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#mapToParent">mapToParent</a>(), <a href="qgraphicsitem.html#mapToItem">mapToItem</a>(), <a href="qgraphicsitem.html#transform">transform</a>(), and <a href="graphicsview.html#the-graphics-view-coordinate-system">The
Graphics View Coordinate System</a>.</p>


<h3 class="fn"><a name="mapFromParent-4" /><a href="qpainterpath.html">QPainterPath</a> QGraphicsItem.mapFromParent (<i>self</i>, <a href="qpainterpath.html">QPainterPath</a>&#160;<i>path</i>)</h3><p>Maps the path <i>path</i>, which is in this item's parent's
coordinate system, to this item's coordinate system, and returns
the mapped path.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#mapFromScene">mapFromScene</a>(), <a href="qgraphicsitem.html#mapFromItem">mapFromItem</a>(), <a href="qgraphicsitem.html#mapToParent">mapToParent</a>(), and <a href="graphicsview.html#the-graphics-view-coordinate-system">The
Graphics View Coordinate System</a>.</p>


<h3 class="fn"><a name="mapFromParent-5" /><a href="qpointf.html">QPointF</a> QGraphicsItem.mapFromParent (<i>self</i>, float&#160;<i>ax</i>, float&#160;<i>ay</i>)</h3><p>This convenience function is equivalent to calling
mapFromItem(<a href="qrectf.html">QRectF</a>(<i>x</i>, <i>y</i>,
<i>w</i>, <i>h</i>)).</p>
<p>This function was introduced in Qt 4.3.</p>


<h3 class="fn"><a name="mapFromParent-6" /><a href="qpolygonf.html">QPolygonF</a> QGraphicsItem.mapFromParent (<i>self</i>, float&#160;<i>ax</i>, float&#160;<i>ay</i>, float&#160;<i>w</i>, float&#160;<i>h</i>)</h3><p>This is an overloaded function.</p>
<p>This convenience function is equivalent to calling
mapFromParent(<a href="qpointf.html">QPointF</a>(<i>x</i>,
<i>y</i>)).</p>


<h3 class="fn"><a name="mapFromScene" /><a href="qpointf.html">QPointF</a> QGraphicsItem.mapFromScene (<i>self</i>, <a href="qpointf.html">QPointF</a>&#160;<i>point</i>)</h3><p>Maps the point <i>point</i>, which is in this item's scene's
coordinate system, to this item's coordinate system, and returns
the mapped coordinate.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#mapFromItem">mapFromItem</a>(), <a href="qgraphicsitem.html#mapFromParent">mapFromParent</a>(), <a href="qgraphicsitem.html#transform">transform</a>(), <a href="qgraphicsitem.html#mapToScene">mapToScene</a>(), and <a href="graphicsview.html#the-graphics-view-coordinate-system">The
Graphics View Coordinate System</a>.</p>


<h3 class="fn"><a name="mapFromScene-2" /><a href="qpolygonf.html">QPolygonF</a> QGraphicsItem.mapFromScene (<i>self</i>, <a href="qrectf.html">QRectF</a>&#160;<i>rect</i>)</h3><p>Maps the rectangle <i>rect</i>, which is in this item's scene's
coordinate system, to this item's coordinate system, and returns
the mapped rectangle as a polygon.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#mapToScene">mapToScene</a>(), <a href="qgraphicsitem.html#mapFromItem">mapFromItem</a>(), <a href="qgraphicsitem.html#transform">transform</a>(), and <a href="graphicsview.html#the-graphics-view-coordinate-system">The
Graphics View Coordinate System</a>.</p>


<h3 class="fn"><a name="mapFromScene-3" /><a href="qpolygonf.html">QPolygonF</a> QGraphicsItem.mapFromScene (<i>self</i>, <a href="qpolygonf.html">QPolygonF</a>&#160;<i>polygon</i>)</h3><p>Maps the polygon <i>polygon</i>, which is in this item's scene's
coordinate system, to this item's coordinate system, and returns
the mapped polygon.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#mapToScene">mapToScene</a>(), <a href="qgraphicsitem.html#mapFromParent">mapFromParent</a>(), <a href="qgraphicsitem.html#transform">transform</a>(), and <a href="graphicsview.html#the-graphics-view-coordinate-system">The
Graphics View Coordinate System</a>.</p>


<h3 class="fn"><a name="mapFromScene-4" /><a href="qpainterpath.html">QPainterPath</a> QGraphicsItem.mapFromScene (<i>self</i>, <a href="qpainterpath.html">QPainterPath</a>&#160;<i>path</i>)</h3><p>Maps the path <i>path</i>, which is in this item's scene's
coordinate system, to this item's coordinate system, and returns
the mapped path.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#mapFromParent">mapFromParent</a>(), <a href="qgraphicsitem.html#mapFromItem">mapFromItem</a>(), <a href="qgraphicsitem.html#mapToScene">mapToScene</a>(), and <a href="graphicsview.html#the-graphics-view-coordinate-system">The
Graphics View Coordinate System</a>.</p>


<h3 class="fn"><a name="mapFromScene-5" /><a href="qpointf.html">QPointF</a> QGraphicsItem.mapFromScene (<i>self</i>, float&#160;<i>ax</i>, float&#160;<i>ay</i>)</h3><p>This convenience function is equivalent to calling
mapFromScene(<a href="qrectf.html">QRectF</a>(<i>x</i>, <i>y</i>,
<i>w</i>, <i>h</i>)).</p>
<p>This function was introduced in Qt 4.3.</p>


<h3 class="fn"><a name="mapFromScene-6" /><a href="qpolygonf.html">QPolygonF</a> QGraphicsItem.mapFromScene (<i>self</i>, float&#160;<i>ax</i>, float&#160;<i>ay</i>, float&#160;<i>w</i>, float&#160;<i>h</i>)</h3><p>This is an overloaded function.</p>
<p>This convenience function is equivalent to calling
mapFromScene(<a href="qpointf.html">QPointF</a>(<i>x</i>,
<i>y</i>)).</p>


<h3 class="fn"><a name="mapRectFromItem" /><a href="qrectf.html">QRectF</a> QGraphicsItem.mapRectFromItem (<i>self</i>, <a href="qgraphicsitem.html">QGraphicsItem</a>&#160;<i>item</i>, <a href="qrectf.html">QRectF</a>&#160;<i>rect</i>)</h3><p>Maps the rectangle <i>rect</i>, which is in <i>item</i>'s
coordinate system, to this item's coordinate system, and returns
the mapped rectangle as a new rectangle (i.e., the bounding
rectangle of the resulting polygon).</p>
<p>If <i>item</i> is 0, this function returns the same as <a href="qgraphicsitem.html#mapRectFromScene">mapRectFromScene</a>().</p>
<p>This function was introduced in Qt 4.5.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#itemTransform">itemTransform</a>(), <a href="qgraphicsitem.html#mapToParent">mapToParent</a>(), <a href="qgraphicsitem.html#mapToScene">mapToScene</a>(), <a href="qgraphicsitem.html#mapFromItem">mapFromItem</a>(), and <a href="graphicsview.html#the-graphics-view-coordinate-system">The
Graphics View Coordinate System</a>.</p>


<h3 class="fn"><a name="mapRectFromItem-2" /><a href="qrectf.html">QRectF</a> QGraphicsItem.mapRectFromItem (<i>self</i>, <a href="qgraphicsitem.html">QGraphicsItem</a>&#160;<i>item</i>, float&#160;<i>ax</i>, float&#160;<i>ay</i>, float&#160;<i>w</i>, float&#160;<i>h</i>)</h3><p>This convenience function is equivalent to calling
mapRectFromItem(item, <a href="qrectf.html">QRectF</a>(<i>x</i>,
<i>y</i>, <i>w</i>, <i>h</i>)).</p>
<p>This function was introduced in Qt 4.5.</p>


<h3 class="fn"><a name="mapRectFromParent" /><a href="qrectf.html">QRectF</a> QGraphicsItem.mapRectFromParent (<i>self</i>, <a href="qrectf.html">QRectF</a>&#160;<i>rect</i>)</h3><p>Maps the rectangle <i>rect</i>, which is in this item's parent's
coordinate system, to this item's coordinate system, and returns
the mapped rectangle as a new rectangle (i.e., the bounding
rectangle of the resulting polygon).</p>
<p>This function was introduced in Qt 4.5.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#itemTransform">itemTransform</a>(), <a href="qgraphicsitem.html#mapToParent">mapToParent</a>(), <a href="qgraphicsitem.html#mapToScene">mapToScene</a>(), <a href="qgraphicsitem.html#mapFromItem">mapFromItem</a>(), and <a href="graphicsview.html#the-graphics-view-coordinate-system">The
Graphics View Coordinate System</a>.</p>


<h3 class="fn"><a name="mapRectFromParent-2" /><a href="qrectf.html">QRectF</a> QGraphicsItem.mapRectFromParent (<i>self</i>, float&#160;<i>ax</i>, float&#160;<i>ay</i>, float&#160;<i>w</i>, float&#160;<i>h</i>)</h3><p>This convenience function is equivalent to calling
mapRectFromParent(<a href="qrectf.html">QRectF</a>(<i>x</i>,
<i>y</i>, <i>w</i>, <i>h</i>)).</p>
<p>This function was introduced in Qt 4.5.</p>


<h3 class="fn"><a name="mapRectFromScene" /><a href="qrectf.html">QRectF</a> QGraphicsItem.mapRectFromScene (<i>self</i>, <a href="qrectf.html">QRectF</a>&#160;<i>rect</i>)</h3><p>Maps the rectangle <i>rect</i>, which is in scene coordinates,
to this item's coordinate system, and returns the mapped rectangle
as a new rectangle (i.e., the bounding rectangle of the resulting
polygon).</p>
<p>This function was introduced in Qt 4.5.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#itemTransform">itemTransform</a>(), <a href="qgraphicsitem.html#mapToParent">mapToParent</a>(), <a href="qgraphicsitem.html#mapToScene">mapToScene</a>(), <a href="qgraphicsitem.html#mapFromItem">mapFromItem</a>(), and <a href="graphicsview.html#the-graphics-view-coordinate-system">The
Graphics View Coordinate System</a>.</p>


<h3 class="fn"><a name="mapRectFromScene-2" /><a href="qrectf.html">QRectF</a> QGraphicsItem.mapRectFromScene (<i>self</i>, float&#160;<i>ax</i>, float&#160;<i>ay</i>, float&#160;<i>w</i>, float&#160;<i>h</i>)</h3><p>This convenience function is equivalent to calling
mapRectFromScene(<a href="qrectf.html">QRectF</a>(<i>x</i>,
<i>y</i>, <i>w</i>, <i>h</i>)).</p>
<p>This function was introduced in Qt 4.5.</p>


<h3 class="fn"><a name="mapRectToItem" /><a href="qrectf.html">QRectF</a> QGraphicsItem.mapRectToItem (<i>self</i>, <a href="qgraphicsitem.html">QGraphicsItem</a>&#160;<i>item</i>, <a href="qrectf.html">QRectF</a>&#160;<i>rect</i>)</h3><p>Maps the rectangle <i>rect</i>, which is in this item's
coordinate system, to <i>item</i>'s coordinate system, and returns
the mapped rectangle as a new rectangle (i.e., the bounding
rectangle of the resulting polygon).</p>
<p>If <i>item</i> is 0, this function returns the same as <a href="qgraphicsitem.html#mapRectToScene">mapRectToScene</a>().</p>
<p>This function was introduced in Qt 4.5.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#itemTransform">itemTransform</a>(), <a href="qgraphicsitem.html#mapToParent">mapToParent</a>(), <a href="qgraphicsitem.html#mapToScene">mapToScene</a>(), <a href="qgraphicsitem.html#mapFromItem">mapFromItem</a>(), and <a href="graphicsview.html#the-graphics-view-coordinate-system">The
Graphics View Coordinate System</a>.</p>


<h3 class="fn"><a name="mapRectToItem-2" /><a href="qrectf.html">QRectF</a> QGraphicsItem.mapRectToItem (<i>self</i>, <a href="qgraphicsitem.html">QGraphicsItem</a>&#160;<i>item</i>, float&#160;<i>ax</i>, float&#160;<i>ay</i>, float&#160;<i>w</i>, float&#160;<i>h</i>)</h3><p>This convenience function is equivalent to calling
mapRectToItem(item, <a href="qrectf.html">QRectF</a>(<i>x</i>,
<i>y</i>, <i>w</i>, <i>h</i>)).</p>
<p>This function was introduced in Qt 4.5.</p>


<h3 class="fn"><a name="mapRectToParent" /><a href="qrectf.html">QRectF</a> QGraphicsItem.mapRectToParent (<i>self</i>, <a href="qrectf.html">QRectF</a>&#160;<i>rect</i>)</h3><p>Maps the rectangle <i>rect</i>, which is in this item's
coordinate system, to its parent's coordinate system, and returns
the mapped rectangle as a new rectangle (i.e., the bounding
rectangle of the resulting polygon).</p>
<p>This function was introduced in Qt 4.5.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#itemTransform">itemTransform</a>(), <a href="qgraphicsitem.html#mapToParent">mapToParent</a>(), <a href="qgraphicsitem.html#mapToScene">mapToScene</a>(), <a href="qgraphicsitem.html#mapFromItem">mapFromItem</a>(), and <a href="graphicsview.html#the-graphics-view-coordinate-system">The
Graphics View Coordinate System</a>.</p>


<h3 class="fn"><a name="mapRectToParent-2" /><a href="qrectf.html">QRectF</a> QGraphicsItem.mapRectToParent (<i>self</i>, float&#160;<i>ax</i>, float&#160;<i>ay</i>, float&#160;<i>w</i>, float&#160;<i>h</i>)</h3><p>This convenience function is equivalent to calling
mapRectToParent(<a href="qrectf.html">QRectF</a>(<i>x</i>,
<i>y</i>, <i>w</i>, <i>h</i>)).</p>
<p>This function was introduced in Qt 4.5.</p>


<h3 class="fn"><a name="mapRectToScene" /><a href="qrectf.html">QRectF</a> QGraphicsItem.mapRectToScene (<i>self</i>, <a href="qrectf.html">QRectF</a>&#160;<i>rect</i>)</h3><p>Maps the rectangle <i>rect</i>, which is in this item's
coordinate system, to the scene coordinate system, and returns the
mapped rectangle as a new rectangle (i.e., the bounding rectangle
of the resulting polygon).</p>
<p>This function was introduced in Qt 4.5.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#itemTransform">itemTransform</a>(), <a href="qgraphicsitem.html#mapToParent">mapToParent</a>(), <a href="qgraphicsitem.html#mapToScene">mapToScene</a>(), <a href="qgraphicsitem.html#mapFromItem">mapFromItem</a>(), and <a href="graphicsview.html#the-graphics-view-coordinate-system">The
Graphics View Coordinate System</a>.</p>


<h3 class="fn"><a name="mapRectToScene-2" /><a href="qrectf.html">QRectF</a> QGraphicsItem.mapRectToScene (<i>self</i>, float&#160;<i>ax</i>, float&#160;<i>ay</i>, float&#160;<i>w</i>, float&#160;<i>h</i>)</h3><p>This convenience function is equivalent to calling
mapRectToScene(<a href="qrectf.html">QRectF</a>(<i>x</i>, <i>y</i>,
<i>w</i>, <i>h</i>)).</p>
<p>This function was introduced in Qt 4.5.</p>


<h3 class="fn"><a name="mapToItem" /><a href="qpointf.html">QPointF</a> QGraphicsItem.mapToItem (<i>self</i>, <a href="qgraphicsitem.html">QGraphicsItem</a>&#160;<i>item</i>, <a href="qpointf.html">QPointF</a>&#160;<i>point</i>)</h3><p>Maps the point <i>point</i>, which is in this item's coordinate
system, to <i>item</i>'s coordinate system, and returns the mapped
coordinate.</p>
<p>If <i>item</i> is 0, this function returns the same as <a href="qgraphicsitem.html#mapToScene">mapToScene</a>().</p>
<p><b>See also</b> <a href="qgraphicsitem.html#itemTransform">itemTransform</a>(), <a href="qgraphicsitem.html#mapToParent">mapToParent</a>(), <a href="qgraphicsitem.html#mapToScene">mapToScene</a>(), <a href="qgraphicsitem.html#transform">transform</a>(), <a href="qgraphicsitem.html#mapFromItem">mapFromItem</a>(), and <a href="graphicsview.html#the-graphics-view-coordinate-system">The
Graphics View Coordinate System</a>.</p>


<h3 class="fn"><a name="mapToItem-2" /><a href="qpolygonf.html">QPolygonF</a> QGraphicsItem.mapToItem (<i>self</i>, <a href="qgraphicsitem.html">QGraphicsItem</a>&#160;<i>item</i>, <a href="qrectf.html">QRectF</a>&#160;<i>rect</i>)</h3><p>Maps the rectangle <i>rect</i>, which is in this item's
coordinate system, to <i>item</i>'s coordinate system, and returns
the mapped rectangle as a polygon.</p>
<p>If <i>item</i> is 0, this function returns the same as <a href="qgraphicsitem.html#mapToScene">mapToScene</a>().</p>
<p><b>See also</b> <a href="qgraphicsitem.html#itemTransform">itemTransform</a>(), <a href="qgraphicsitem.html#mapToParent">mapToParent</a>(), <a href="qgraphicsitem.html#mapToScene">mapToScene</a>(), <a href="qgraphicsitem.html#mapFromItem">mapFromItem</a>(), and <a href="graphicsview.html#the-graphics-view-coordinate-system">The
Graphics View Coordinate System</a>.</p>


<h3 class="fn"><a name="mapToItem-3" /><a href="qpolygonf.html">QPolygonF</a> QGraphicsItem.mapToItem (<i>self</i>, <a href="qgraphicsitem.html">QGraphicsItem</a>&#160;<i>item</i>, <a href="qpolygonf.html">QPolygonF</a>&#160;<i>polygon</i>)</h3><p>Maps the polygon <i>polygon</i>, which is in this item's
coordinate system, to <i>item</i>'s coordinate system, and returns
the mapped polygon.</p>
<p>If <i>item</i> is 0, this function returns the same as <a href="qgraphicsitem.html#mapToScene">mapToScene</a>().</p>
<p><b>See also</b> <a href="qgraphicsitem.html#itemTransform">itemTransform</a>(), <a href="qgraphicsitem.html#mapToParent">mapToParent</a>(), <a href="qgraphicsitem.html#mapToScene">mapToScene</a>(), <a href="qgraphicsitem.html#mapFromItem">mapFromItem</a>(), and <a href="graphicsview.html#the-graphics-view-coordinate-system">The
Graphics View Coordinate System</a>.</p>


<h3 class="fn"><a name="mapToItem-4" /><a href="qpainterpath.html">QPainterPath</a> QGraphicsItem.mapToItem (<i>self</i>, <a href="qgraphicsitem.html">QGraphicsItem</a>&#160;<i>item</i>, <a href="qpainterpath.html">QPainterPath</a>&#160;<i>path</i>)</h3><p>Maps the path <i>path</i>, which is in this item's coordinate
system, to <i>item</i>'s coordinate system, and returns the mapped
path.</p>
<p>If <i>item</i> is 0, this function returns the same as <a href="qgraphicsitem.html#mapToScene">mapToScene</a>().</p>
<p><b>See also</b> <a href="qgraphicsitem.html#itemTransform">itemTransform</a>(), <a href="qgraphicsitem.html#mapToParent">mapToParent</a>(), <a href="qgraphicsitem.html#mapToScene">mapToScene</a>(), <a href="qgraphicsitem.html#mapFromItem">mapFromItem</a>(), and <a href="graphicsview.html#the-graphics-view-coordinate-system">The
Graphics View Coordinate System</a>.</p>


<h3 class="fn"><a name="mapToItem-5" /><a href="qpointf.html">QPointF</a> QGraphicsItem.mapToItem (<i>self</i>, <a href="qgraphicsitem.html">QGraphicsItem</a>&#160;<i>item</i>, float&#160;<i>ax</i>, float&#160;<i>ay</i>)</h3><p>This convenience function is equivalent to calling
mapToItem(item, <a href="qrectf.html">QRectF</a>(<i>x</i>,
<i>y</i>, <i>w</i>, <i>h</i>)).</p>
<p>This function was introduced in Qt 4.3.</p>


<h3 class="fn"><a name="mapToItem-6" /><a href="qpolygonf.html">QPolygonF</a> QGraphicsItem.mapToItem (<i>self</i>, <a href="qgraphicsitem.html">QGraphicsItem</a>&#160;<i>item</i>, float&#160;<i>ax</i>, float&#160;<i>ay</i>, float&#160;<i>w</i>, float&#160;<i>h</i>)</h3><p>This is an overloaded function.</p>
<p>This convenience function is equivalent to calling
mapToItem(<i>item</i>, <a href="qpointf.html">QPointF</a>(<i>x</i>,
<i>y</i>)).</p>


<h3 class="fn"><a name="mapToParent" /><a href="qpointf.html">QPointF</a> QGraphicsItem.mapToParent (<i>self</i>, <a href="qpointf.html">QPointF</a>&#160;<i>point</i>)</h3><p>Maps the point <i>point</i>, which is in this item's coordinate
system, to its parent's coordinate system, and returns the mapped
coordinate. If the item has no parent, <i>point</i> will be mapped
to the scene's coordinate system.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#mapToItem">mapToItem</a>(), <a href="qgraphicsitem.html#mapToScene">mapToScene</a>(), <a href="qgraphicsitem.html#transform">transform</a>(), <a href="qgraphicsitem.html#mapFromParent">mapFromParent</a>(), and
<a href="graphicsview.html#the-graphics-view-coordinate-system">The
Graphics View Coordinate System</a>.</p>


<h3 class="fn"><a name="mapToParent-2" /><a href="qpolygonf.html">QPolygonF</a> QGraphicsItem.mapToParent (<i>self</i>, <a href="qrectf.html">QRectF</a>&#160;<i>rect</i>)</h3><p>Maps the rectangle <i>rect</i>, which is in this item's
coordinate system, to its parent's coordinate system, and returns
the mapped rectangle as a polygon. If the item has no parent,
<i>rect</i> will be mapped to the scene's coordinate system.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#mapToScene">mapToScene</a>(), <a href="qgraphicsitem.html#mapToItem">mapToItem</a>(), <a href="qgraphicsitem.html#mapFromParent">mapFromParent</a>(), and
<a href="graphicsview.html#the-graphics-view-coordinate-system">The
Graphics View Coordinate System</a>.</p>


<h3 class="fn"><a name="mapToParent-3" /><a href="qpolygonf.html">QPolygonF</a> QGraphicsItem.mapToParent (<i>self</i>, <a href="qpolygonf.html">QPolygonF</a>&#160;<i>polygon</i>)</h3><p>Maps the polygon <i>polygon</i>, which is in this item's
coordinate system, to its parent's coordinate system, and returns
the mapped polygon. If the item has no parent, <i>polygon</i> will
be mapped to the scene's coordinate system.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#mapToScene">mapToScene</a>(), <a href="qgraphicsitem.html#mapToItem">mapToItem</a>(), <a href="qgraphicsitem.html#mapFromParent">mapFromParent</a>(), and
<a href="graphicsview.html#the-graphics-view-coordinate-system">The
Graphics View Coordinate System</a>.</p>


<h3 class="fn"><a name="mapToParent-4" /><a href="qpainterpath.html">QPainterPath</a> QGraphicsItem.mapToParent (<i>self</i>, <a href="qpainterpath.html">QPainterPath</a>&#160;<i>path</i>)</h3><p>Maps the path <i>path</i>, which is in this item's coordinate
system, to its parent's coordinate system, and returns the mapped
path. If the item has no parent, <i>path</i> will be mapped to the
scene's coordinate system.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#mapToScene">mapToScene</a>(), <a href="qgraphicsitem.html#mapToItem">mapToItem</a>(), <a href="qgraphicsitem.html#mapFromParent">mapFromParent</a>(), and
<a href="graphicsview.html#the-graphics-view-coordinate-system">The
Graphics View Coordinate System</a>.</p>


<h3 class="fn"><a name="mapToParent-5" /><a href="qpointf.html">QPointF</a> QGraphicsItem.mapToParent (<i>self</i>, float&#160;<i>ax</i>, float&#160;<i>ay</i>)</h3><p>This convenience function is equivalent to calling
mapToParent(<a href="qrectf.html">QRectF</a>(<i>x</i>, <i>y</i>,
<i>w</i>, <i>h</i>)).</p>
<p>This function was introduced in Qt 4.3.</p>


<h3 class="fn"><a name="mapToParent-6" /><a href="qpolygonf.html">QPolygonF</a> QGraphicsItem.mapToParent (<i>self</i>, float&#160;<i>ax</i>, float&#160;<i>ay</i>, float&#160;<i>w</i>, float&#160;<i>h</i>)</h3><p>This is an overloaded function.</p>
<p>This convenience function is equivalent to calling
mapToParent(<a href="qpointf.html">QPointF</a>(<i>x</i>,
<i>y</i>)).</p>


<h3 class="fn"><a name="mapToScene" /><a href="qpointf.html">QPointF</a> QGraphicsItem.mapToScene (<i>self</i>, <a href="qpointf.html">QPointF</a>&#160;<i>point</i>)</h3><p>Maps the point <i>point</i>, which is in this item's coordinate
system, to the scene's coordinate system, and returns the mapped
coordinate.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#mapToItem">mapToItem</a>(), <a href="qgraphicsitem.html#mapToParent">mapToParent</a>(), <a href="qgraphicsitem.html#transform">transform</a>(), <a href="qgraphicsitem.html#mapFromScene">mapFromScene</a>(), and <a href="graphicsview.html#the-graphics-view-coordinate-system">The
Graphics View Coordinate System</a>.</p>


<h3 class="fn"><a name="mapToScene-2" /><a href="qpolygonf.html">QPolygonF</a> QGraphicsItem.mapToScene (<i>self</i>, <a href="qrectf.html">QRectF</a>&#160;<i>rect</i>)</h3><p>Maps the rectangle <i>rect</i>, which is in this item's
coordinate system, to the scene's coordinate system, and returns
the mapped rectangle as a polygon.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#mapToParent">mapToParent</a>(), <a href="qgraphicsitem.html#mapToItem">mapToItem</a>(), <a href="qgraphicsitem.html#mapFromScene">mapFromScene</a>(), and <a href="graphicsview.html#the-graphics-view-coordinate-system">The
Graphics View Coordinate System</a>.</p>


<h3 class="fn"><a name="mapToScene-3" /><a href="qpolygonf.html">QPolygonF</a> QGraphicsItem.mapToScene (<i>self</i>, <a href="qpolygonf.html">QPolygonF</a>&#160;<i>polygon</i>)</h3><p>Maps the polygon <i>polygon</i>, which is in this item's
coordinate system, to the scene's coordinate system, and returns
the mapped polygon.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#mapToParent">mapToParent</a>(), <a href="qgraphicsitem.html#mapToItem">mapToItem</a>(), <a href="qgraphicsitem.html#mapFromScene">mapFromScene</a>(), and <a href="graphicsview.html#the-graphics-view-coordinate-system">The
Graphics View Coordinate System</a>.</p>


<h3 class="fn"><a name="mapToScene-4" /><a href="qpainterpath.html">QPainterPath</a> QGraphicsItem.mapToScene (<i>self</i>, <a href="qpainterpath.html">QPainterPath</a>&#160;<i>path</i>)</h3><p>Maps the path <i>path</i>, which is in this item's coordinate
system, to the scene's coordinate system, and returns the mapped
path.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#mapToParent">mapToParent</a>(), <a href="qgraphicsitem.html#mapToItem">mapToItem</a>(), <a href="qgraphicsitem.html#mapFromScene">mapFromScene</a>(), and <a href="graphicsview.html#the-graphics-view-coordinate-system">The
Graphics View Coordinate System</a>.</p>


<h3 class="fn"><a name="mapToScene-5" /><a href="qpointf.html">QPointF</a> QGraphicsItem.mapToScene (<i>self</i>, float&#160;<i>ax</i>, float&#160;<i>ay</i>)</h3><p>This convenience function is equivalent to calling
mapToScene(<a href="qrectf.html">QRectF</a>(<i>x</i>, <i>y</i>,
<i>w</i>, <i>h</i>)).</p>
<p>This function was introduced in Qt 4.3.</p>


<h3 class="fn"><a name="mapToScene-6" /><a href="qpolygonf.html">QPolygonF</a> QGraphicsItem.mapToScene (<i>self</i>, float&#160;<i>ax</i>, float&#160;<i>ay</i>, float&#160;<i>w</i>, float&#160;<i>h</i>)</h3><p>This is an overloaded function.</p>
<p>This convenience function is equivalent to calling
mapToScene(<a href="qpointf.html">QPointF</a>(<i>x</i>,
<i>y</i>)).</p>


<h3 class="fn"><a name="matrix" /><a href="qmatrix.html">QMatrix</a> QGraphicsItem.matrix (<i>self</i>)</h3><h3 class="fn"><a name="mouseDoubleClickEvent" />QGraphicsItem.mouseDoubleClickEvent (<i>self</i>, <a href="qgraphicsscenemouseevent.html">QGraphicsSceneMouseEvent</a>&#160;<i>event</i>)</h3><p>This event handler, for event <i>event</i>, can be reimplemented
to receive mouse doubleclick events for this item.</p>
<p>When doubleclicking an item, the item will first receive a mouse
press event, followed by a release event (i.e., a click), then a
doubleclick event, and finally a release event.</p>
<p>Calling <a href="qevent.html#ignore">QEvent.ignore</a>() or
<a href="qevent.html#accept">QEvent.accept</a>() on <i>event</i>
has no effect.</p>
<p>The default implementation calls <a href="qgraphicsitem.html#mousePressEvent">mousePressEvent</a>(). If you
want to keep the base implementation when reimplementing this
function, call QGraphicsItem.mouseDoubleClickEvent() in your
reimplementation.</p>
<p>Note that an item will not receive double click events if it is
neither <a href="qgraphicsitem.html#GraphicsItemFlag-enum">selectable</a> nor
<a href="qgraphicsitem.html#GraphicsItemFlag-enum">movable</a>
(single mouse clicks are ignored in this case, and that stops the
generation of double clicks).</p>
<p><b>See also</b> <a href="qgraphicsitem.html#mousePressEvent">mousePressEvent</a>(),
<a href="qgraphicsitem.html#mouseMoveEvent">mouseMoveEvent</a>(),
<a href="qgraphicsitem.html#mouseReleaseEvent">mouseReleaseEvent</a>(), and
<a href="qgraphicsitem.html#sceneEvent">sceneEvent</a>().</p>


<h3 class="fn"><a name="mouseMoveEvent" />QGraphicsItem.mouseMoveEvent (<i>self</i>, <a href="qgraphicsscenemouseevent.html">QGraphicsSceneMouseEvent</a>&#160;<i>event</i>)</h3><p>This event handler, for event <i>event</i>, can be reimplemented
to receive mouse move events for this item. If you do receive this
event, you can be certain that this item also received a mouse
press event, and that this item is the current mouse grabber.</p>
<p>Calling <a href="qevent.html#ignore">QEvent.ignore</a>() or
<a href="qevent.html#accept">QEvent.accept</a>() on <i>event</i>
has no effect.</p>
<p>The default implementation handles basic item interaction, such
as selection and moving. If you want to keep the base
implementation when reimplementing this function, call
QGraphicsItem.mouseMoveEvent() in your reimplementation.</p>
<p>Please note that <a href="qgraphicsitem.html#mousePressEvent">mousePressEvent</a>() decides
which graphics item it is that receives mouse events. See the
<a href="qgraphicsitem.html#mousePressEvent">mousePressEvent</a>()
description for details.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#mousePressEvent">mousePressEvent</a>(),
<a href="qgraphicsitem.html#mouseReleaseEvent">mouseReleaseEvent</a>(),
<a href="qgraphicsitem.html#mouseDoubleClickEvent">mouseDoubleClickEvent</a>(),
and <a href="qgraphicsitem.html#sceneEvent">sceneEvent</a>().</p>


<h3 class="fn"><a name="mousePressEvent" />QGraphicsItem.mousePressEvent (<i>self</i>, <a href="qgraphicsscenemouseevent.html">QGraphicsSceneMouseEvent</a>&#160;<i>event</i>)</h3><p>This event handler, for event <i>event</i>, can be reimplemented
to receive mouse press events for this item. Mouse press events are
only delivered to items that accept the mouse button that is
pressed. By default, an item accepts all mouse buttons, but you can
change this by calling <a href="qgraphicsitem.html#setAcceptedMouseButtons">setAcceptedMouseButtons</a>().</p>
<p>The mouse press event decides which item should become the mouse
grabber (see <a href="qgraphicsscene.html#mouseGrabberItem">QGraphicsScene.mouseGrabberItem</a>()).
If you do not reimplement this function, the press event will
propagate to any topmost item beneath this item, and no other mouse
events will be delivered to this item.</p>
<p>If you do reimplement this function, <i>event</i> will by
default be accepted (see <a href="qevent.html#accept">QEvent.accept</a>()), and this item is then
the mouse grabber. This allows the item to receive future move,
release and doubleclick events. If you call <a href="qevent.html#ignore">QEvent.ignore</a>() on <i>event</i>, this
item will lose the mouse grab, and <i>event</i> will propagate to
any topmost item beneath. No further mouse events will be delivered
to this item unless a new mouse press event is received.</p>
<p>The default implementation handles basic item interaction, such
as selection and moving. If you want to keep the base
implementation when reimplementing this function, call
QGraphicsItem.mousePressEvent() in your reimplementation.</p>
<p>The event is <a href="qevent.html#ignore">QEvent.ignore</a>()d
for items that are neither <a href="qgraphicsitem.html#GraphicsItemFlag-enum">movable</a> nor <a href="qgraphicsitem.html#GraphicsItemFlag-enum">selectable</a>.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#mouseMoveEvent">mouseMoveEvent</a>(), <a href="qgraphicsitem.html#mouseReleaseEvent">mouseReleaseEvent</a>(),
<a href="qgraphicsitem.html#mouseDoubleClickEvent">mouseDoubleClickEvent</a>(),
and <a href="qgraphicsitem.html#sceneEvent">sceneEvent</a>().</p>


<h3 class="fn"><a name="mouseReleaseEvent" />QGraphicsItem.mouseReleaseEvent (<i>self</i>, <a href="qgraphicsscenemouseevent.html">QGraphicsSceneMouseEvent</a>&#160;<i>event</i>)</h3><p>This event handler, for event <i>event</i>, can be reimplemented
to receive mouse release events for this item.</p>
<p>Calling <a href="qevent.html#ignore">QEvent.ignore</a>() or
<a href="qevent.html#accept">QEvent.accept</a>() on <i>event</i>
has no effect.</p>
<p>The default implementation handles basic item interaction, such
as selection and moving. If you want to keep the base
implementation when reimplementing this function, call
QGraphicsItem.mouseReleaseEvent() in your reimplementation.</p>
<p>Please note that <a href="qgraphicsitem.html#mousePressEvent">mousePressEvent</a>() decides
which graphics item it is that receives mouse events. See the
<a href="qgraphicsitem.html#mousePressEvent">mousePressEvent</a>()
description for details.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#mousePressEvent">mousePressEvent</a>(),
<a href="qgraphicsitem.html#mouseMoveEvent">mouseMoveEvent</a>(),
<a href="qgraphicsitem.html#mouseDoubleClickEvent">mouseDoubleClickEvent</a>(),
and <a href="qgraphicsitem.html#sceneEvent">sceneEvent</a>().</p>


<h3 class="fn"><a name="moveBy" />QGraphicsItem.moveBy (<i>self</i>, float&#160;<i>dx</i>, float&#160;<i>dy</i>)</h3><p>Moves the item by <i>dx</i> points horizontally, and <i>dy</i>
point vertically. This function is equivalent to calling
setPos(<a href="qgraphicsitem.html#pos">pos</a>() + <a href="qpointf.html">QPointF</a>(<i>dx</i>, <i>dy</i>)).</p>


<h3 class="fn"><a name="opacity" />float QGraphicsItem.opacity (<i>self</i>)</h3><p>Returns this item's local opacity, which is between 0.0
(transparent) and 1.0 (opaque). This value is combined with parent
and ancestor values into the <a href="qgraphicsitem.html#effectiveOpacity">effectiveOpacity</a>(). The
effective opacity decides how the item is rendered.</p>
<p>The opacity property decides the state of the painter passed to
the <a href="qgraphicsitem.html#paint">paint</a>() function. If the
item is cached, i.e., <a href="qgraphicsitem.html#CacheMode-enum">ItemCoordinateCache</a> or
<a href="qgraphicsitem.html#CacheMode-enum">DeviceCoordinateCache</a>, the
effective property will be applied to the item's cache as it is
rendered.</p>
<p>The default opacity is 1.0; fully opaque.</p>
<p>This function was introduced in Qt 4.5.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#setOpacity">setOpacity</a>(), <a href="qgraphicsitem.html#paint">paint</a>(), <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemIgnoresParentOpacity</a>,
and <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemDoesntPropagateOpacityToChildren</a>.</p>


<h3 class="fn"><a name="opaqueArea" /><a href="qpainterpath.html">QPainterPath</a> QGraphicsItem.opaqueArea (<i>self</i>)</h3><p>This virtual function returns a shape representing the area
where this item is opaque. An area is opaque if it is filled using
an opaque brush or color (i.e., not transparent).</p>
<p>This function is used by <a href="qgraphicsitem.html#isObscuredBy">isObscuredBy</a>(), which is
called by underlying items to determine if they are obscured by
this item.</p>
<p>The default implementation returns an empty <a href="qpainterpath.html">QPainterPath</a>, indicating that this item is
completely transparent and does not obscure any other items.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#isObscuredBy">isObscuredBy</a>(), <a href="qgraphicsitem.html#isObscured">isObscured</a>(), and <a href="qgraphicsitem.html#shape">shape</a>().</p>


<h3 class="fn"><a name="paint" />QGraphicsItem.paint (<i>self</i>, <a href="qpainter.html">QPainter</a>&#160;<i>painter</i>, <a href="qstyleoptiongraphicsitem.html">QStyleOptionGraphicsItem</a>&#160;<i>option</i>, <a href="qwidget.html">QWidget</a>&#160;<i>widget</i>&#160;=&#160;None)</h3><p>This method is abstract and should be reimplemented in any sub-class.</p><p>This function, which is usually called by <a href="qgraphicsview.html">QGraphicsView</a>, paints the contents of an
item in local coordinates.</p>
<p>Reimplement this function in a <a href="qgraphicsitem.html">QGraphicsItem</a> subclass to provide the
item's painting implementation, using <i>painter</i>. The
<i>option</i> parameter provides style options for the item, such
as its state, exposed area and its level-of-detail hints. The
<i>widget</i> argument is optional. If provided, it points to the
widget that is being painted on; otherwise, it is 0. For cached
painting, <i>widget</i> is always 0.</p>
<pre class="cpp">
 <span class="type">void</span> RoundRectItem<span class="operator">.</span>paint(<span class="type"><a href="qpainter.html">QPainter</a></span> <span class="operator">*</span>painter<span class="operator">,</span>
                           <span class="keyword">const</span> <span class="type"><a href="qstyleoptiongraphicsitem.html">QStyleOptionGraphicsItem</a></span> <span class="operator">*</span>option<span class="operator">,</span>
                           <span class="type"><a href="qwidget.html">QWidget</a></span> <span class="operator">*</span>widget)
 {
     painter<span class="operator">-</span><span class="operator">&gt;</span>drawRoundedRect(<span class="operator">-</span><span class="number">10</span><span class="operator">,</span> <span class="operator">-</span><span class="number">10</span><span class="operator">,</span> <span class="number">20</span><span class="operator">,</span> <span class="number">20</span><span class="operator">,</span> <span class="number">5</span><span class="operator">,</span> <span class="number">5</span>);
 }
</pre>
<p>The painter's pen is 0-width by default, and its pen is
initialized to the <a href="qpalette.html#ColorRole-enum">QPalette.Text</a> brush from the
paint device's palette. The brush is initialized to <a href="qpalette.html#ColorRole-enum">QPalette.Window</a>.</p>
<p>Make sure to constrain all painting inside the boundaries of
<a href="qgraphicsitem.html#boundingRect">boundingRect</a>() to
avoid rendering artifacts (as <a href="qgraphicsview.html">QGraphicsView</a> does not clip the painter
for you). In particular, when <a href="qpainter.html">QPainter</a>
renders the outline of a shape using an assigned <a href="qpen.html">QPen</a>, half of the outline will be drawn outside,
and half inside, the shape you're rendering (e.g., with a pen width
of 2 units, you must draw outlines 1 unit inside <a href="qgraphicsitem.html#boundingRect">boundingRect</a>()). <a href="qgraphicsitem.html">QGraphicsItem</a> does not support use of
cosmetic pens with a non-zero width.</p>
<p>All painting is done in local coordinates.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#setCacheMode">setCacheMode</a>(), <a href="qpen.html#width">QPen.width</a>(), <a href="graphicsview.html#item-coordinates">Item Coordinates</a>, and
<a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemUsesExtendedStyleOption</a>.</p>


<h3 class="fn"><a name="panel" /><a href="qgraphicsitem.html">QGraphicsItem</a> QGraphicsItem.panel (<i>self</i>)</h3><p>Returns the item's panel, or 0 if this item does not have a
panel. If the item is a panel, it will return itself. Otherwise it
will return the closest ancestor that is a panel.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#isPanel">isPanel</a>() and <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemIsPanel</a>.</p>


<h3 class="fn"><a name="panelModality" /><a href="qgraphicsitem.html#PanelModality-enum">PanelModality</a> QGraphicsItem.panelModality (<i>self</i>)</h3><p>Returns the modality for this item.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#setPanelModality">setPanelModality</a>().</p>


<h3 class="fn"><a name="parentItem" /><a href="qgraphicsitem.html">QGraphicsItem</a> QGraphicsItem.parentItem (<i>self</i>)</h3><p>Returns a pointer to this item's parent item. If this item does
not have a parent, 0 is returned.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#setParentItem">setParentItem</a>() and <a href="qgraphicsitem.html#childItems">childItems</a>().</p>


<h3 class="fn"><a name="parentObject" /><a href="qgraphicsobject.html">QGraphicsObject</a> QGraphicsItem.parentObject (<i>self</i>)</h3><p>Returns a pointer to the item's parent, cast to a <a href="qgraphicsobject.html">QGraphicsObject</a>. returns 0 if the parent
item is not a <a href="qgraphicsobject.html">QGraphicsObject</a>.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#parentItem">parentItem</a>() and <a href="qgraphicsitem.html#childItems">childItems</a>().</p>


<h3 class="fn"><a name="parentWidget" /><a href="qgraphicswidget.html">QGraphicsWidget</a> QGraphicsItem.parentWidget (<i>self</i>)</h3><p>Returns a pointer to the item's parent widget. The item's parent
widget is the closest parent item that is a widget.</p>
<p>This function was introduced in Qt 4.4.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#parentItem">parentItem</a>() and <a href="qgraphicsitem.html#childItems">childItems</a>().</p>


<h3 class="fn"><a name="pos" /><a href="qpointf.html">QPointF</a> QGraphicsItem.pos (<i>self</i>)</h3><p>Returns the position of the item in parent coordinates. If the
item has no parent, its position is given in scene coordinates.</p>
<p>The position of the item describes its origin (local coordinate
(0, 0)) in parent coordinates; this function returns the same as
mapToParent(0, 0).</p>
<p>For convenience, you can also call <a href="qgraphicsitem.html#scenePos">scenePos</a>() to determine the
item's position in scene coordinates, regardless of its parent.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#x">x</a>(), <a href="qgraphicsitem.html#y">y</a>(), <a href="qgraphicsitem.html#setPos">setPos</a>(), <a href="qgraphicsitem.html#transform">transform</a>(), and <a href="graphicsview.html#the-graphics-view-coordinate-system">The
Graphics View Coordinate System</a>.</p>


<h3 class="fn"><a name="prepareGeometryChange" />QGraphicsItem.prepareGeometryChange (<i>self</i>)</h3><p>Prepares the item for a geometry change. Call this function
before changing the bounding rect of an item to keep <a href="qgraphicsscene.html">QGraphicsScene</a>'s index up to date.</p>
<p>prepareGeometryChange() will call <a href="qgraphicsitem.html#update">update</a>() if this is necessary.</p>
<p>Example:</p>
<pre class="cpp">
 <span class="type">void</span> CircleItem<span class="operator">.</span>setRadius(<span class="type"><a href="qtcore.html#qreal-typedef">qreal</a></span> newRadius)
 {
     <span class="keyword">if</span> (radius <span class="operator">!</span><span class="operator">=</span> newRadius) {
         prepareGeometryChange();
         radius <span class="operator">=</span> newRadius;
     }
 }
</pre>
<p><b>See also</b> <a href="qgraphicsitem.html#boundingRect">boundingRect</a>().</p>


<h3 class="fn"><a name="removeSceneEventFilter" />QGraphicsItem.removeSceneEventFilter (<i>self</i>, <a href="qgraphicsitem.html">QGraphicsItem</a>&#160;<i>filterItem</i>)</h3><p>Removes an event filter on this item from <i>filterItem</i>.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#installSceneEventFilter">installSceneEventFilter</a>().</p>


<h3 class="fn"><a name="resetMatrix" />QGraphicsItem.resetMatrix (<i>self</i>)</h3><h3 class="fn"><a name="resetTransform" />QGraphicsItem.resetTransform (<i>self</i>)</h3><p>Resets this item's transformation matrix to the identity matrix
or all the transformation properties to their default values. This
is equivalent to calling <tt>setTransform(QTransform())</tt>.</p>
<p>This function was introduced in Qt 4.3.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#setTransform">setTransform</a>() and <a href="qgraphicsitem.html#transform">transform</a>().</p>


<h3 class="fn"><a name="rotate" />QGraphicsItem.rotate (<i>self</i>, float&#160;<i>angle</i>)</h3><h3 class="fn"><a name="rotation" />float QGraphicsItem.rotation (<i>self</i>)</h3><p>Returns the clockwise rotation, in degrees, around the Z axis.
The default value is 0 (i.e., the item is not rotated).</p>
<p>The rotation is combined with the item's <a href="qgraphicsitem.html#scale">scale</a>(), <a href="qgraphicsitem.html#transform">transform</a>() and <a href="qgraphicsitem.html#transformations">transformations</a>() to map
the item's coordinate system to the parent item.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#setRotation">setRotation</a>(), <a href="qgraphicsitem.html#transformOriginPoint">transformOriginPoint</a>(),
and <a href="qgraphicsitem.html#transformations">Transformations</a>.</p>


<h3 class="fn"><a name="scale" />QGraphicsItem.scale (<i>self</i>, float&#160;<i>sx</i>, float&#160;<i>sy</i>)</h3><p>Returns the scale factor of the item. The default scale factor
is 1.0 (i.e., the item is not scaled).</p>
<p>The scale is combined with the item's <a href="qgraphicsitem.html#rotation">rotation</a>(), <a href="qgraphicsitem.html#transform">transform</a>() and <a href="qgraphicsitem.html#transformations">transformations</a>() to map
the item's coordinate system to the parent item.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#setScale">setScale</a>(), <a href="qgraphicsitem.html#rotation">rotation</a>(), and <a href="qgraphicsitem.html#transformations">Transformations</a>.</p>


<h3 class="fn"><a name="scale-2" />float QGraphicsItem.scale (<i>self</i>)</h3><h3 class="fn"><a name="scene" /><a href="qgraphicsscene.html">QGraphicsScene</a> QGraphicsItem.scene (<i>self</i>)</h3><p>Returns the current scene for the item, or 0 if the item is not
stored in a scene.</p>
<p>To add or move an item to a scene, call <a href="qgraphicsscene.html#addItem">QGraphicsScene.addItem</a>().</p>


<h3 class="fn"><a name="sceneBoundingRect" /><a href="qrectf.html">QRectF</a> QGraphicsItem.sceneBoundingRect (<i>self</i>)</h3><p>Returns the bounding rect of this item in scene coordinates, by
combining <a href="qgraphicsitem.html#sceneTransform">sceneTransform</a>() with
<a href="qgraphicsitem.html#boundingRect">boundingRect</a>().</p>
<p><b>See also</b> <a href="qgraphicsitem.html#boundingRect">boundingRect</a>() and <a href="graphicsview.html#the-graphics-view-coordinate-system">The
Graphics View Coordinate System</a>.</p>


<h3 class="fn"><a name="sceneEvent" />bool QGraphicsItem.sceneEvent (<i>self</i>, <a href="qevent.html">QEvent</a>&#160;<i>event</i>)</h3><p>This virtual function receives events to this item. Reimplement
this function to intercept events before they are dispatched to the
specialized event handlers <a href="qgraphicsitem.html#contextMenuEvent">contextMenuEvent</a>(),
<a href="qgraphicsitem.html#focusInEvent">focusInEvent</a>(),
<a href="qgraphicsitem.html#focusOutEvent">focusOutEvent</a>(),
<a href="qgraphicsitem.html#hoverEnterEvent">hoverEnterEvent</a>(),
<a href="qgraphicsitem.html#hoverMoveEvent">hoverMoveEvent</a>(),
<a href="qgraphicsitem.html#hoverLeaveEvent">hoverLeaveEvent</a>(),
<a href="qgraphicsitem.html#keyPressEvent">keyPressEvent</a>(),
<a href="qgraphicsitem.html#keyReleaseEvent">keyReleaseEvent</a>(),
<a href="qgraphicsitem.html#mousePressEvent">mousePressEvent</a>(),
<a href="qgraphicsitem.html#mouseReleaseEvent">mouseReleaseEvent</a>(),
<a href="qgraphicsitem.html#mouseMoveEvent">mouseMoveEvent</a>(),
and <a href="qgraphicsitem.html#mouseDoubleClickEvent">mouseDoubleClickEvent</a>().</p>
<p>Returns true if the event was recognized and handled; otherwise,
(e.g., if the event type was not recognized,) false is
returned.</p>
<p><i>event</i> is the intercepted event.</p>


<h3 class="fn"><a name="sceneEventFilter" />bool QGraphicsItem.sceneEventFilter (<i>self</i>, <a href="qgraphicsitem.html">QGraphicsItem</a>&#160;<i>watched</i>, <a href="qevent.html">QEvent</a>&#160;<i>event</i>)</h3><p>Filters events for the item <i>watched</i>. <i>event</i> is the
filtered event.</p>
<p>Reimplementing this function in a subclass makes it possible for
the item to be used as an event filter for other items,
intercepting all the events send to those items before they are
able to respond.</p>
<p>Reimplementations must return true to prevent further processing
of a given event, ensuring that it will not be delivered to the
watched item, or return false to indicate that the event should be
propagated further by the event system.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#installSceneEventFilter">installSceneEventFilter</a>().</p>


<h3 class="fn"><a name="sceneMatrix" /><a href="qmatrix.html">QMatrix</a> QGraphicsItem.sceneMatrix (<i>self</i>)</h3><h3 class="fn"><a name="scenePos" /><a href="qpointf.html">QPointF</a> QGraphicsItem.scenePos (<i>self</i>)</h3><p>Returns the item's position in scene coordinates. This is
equivalent to calling <tt>mapToScene(0, 0)</tt>.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#pos">pos</a>(),
<a href="qgraphicsitem.html#sceneTransform">sceneTransform</a>(),
and <a href="graphicsview.html#the-graphics-view-coordinate-system">The
Graphics View Coordinate System</a>.</p>


<h3 class="fn"><a name="sceneTransform" /><a href="qtransform.html">QTransform</a> QGraphicsItem.sceneTransform (<i>self</i>)</h3><p>Returns this item's scene transformation matrix. This matrix can
be used to map coordinates and geometrical shapes from this item's
local coordinate system to the scene's coordinate system. To map
coordinates from the scene, you must first invert the returned
matrix.</p>
<p>Example:</p>
<pre class="cpp">
 <span class="type"><a href="qgraphicsrectitem.html">QGraphicsRectItem</a></span> rect;
 rect<span class="operator">.</span><a href="qgraphicsitem.html#setPos">setPos</a>(<span class="number">100</span><span class="operator">,</span> <span class="number">100</span>);

 rect<span class="operator">.</span>sceneTransform()<span class="operator">.</span>map(<span class="type"><a href="qpointf.html">QPointF</a></span>(<span class="number">0</span><span class="operator">,</span> <span class="number">0</span>));
 <span class="comment">// returns QPointF(100, 100);</span>

 rect<span class="operator">.</span>sceneTransform()<span class="operator">.</span>inverted()<span class="operator">.</span>map(<span class="type"><a href="qpointf.html">QPointF</a></span>(<span class="number">100</span><span class="operator">,</span> <span class="number">100</span>));
 <span class="comment">// returns QPointF(0, 0);</span>
</pre>
<p>Unlike <a href="qgraphicsitem.html#transform">transform</a>(),
which returns only an item's local transformation, this function
includes the item's (and any parents') position, and all the
transfomation properties.</p>
<p>This function was introduced in Qt 4.3.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#transform">transform</a>(), <a href="qgraphicsitem.html#setTransform">setTransform</a>(), <a href="qgraphicsitem.html#scenePos">scenePos</a>(), <a href="graphicsview.html#the-graphics-view-coordinate-system">The
Graphics View Coordinate System</a>, and <a href="qgraphicsitem.html#transformations">Transformations</a>.</p>


<h3 class="fn"><a name="scroll" />QGraphicsItem.scroll (<i>self</i>, float&#160;<i>dx</i>, float&#160;<i>dy</i>, <a href="qrectf.html">QRectF</a>&#160;<i>rect</i>&#160;=&#160;QRectF())</h3><p>Scrolls the contents of <i>rect</i> by <i>dx</i>, <i>dy</i>. If
<i>rect</i> is a null rect (the default), the item's bounding rect
is scrolled.</p>
<p>Scrolling provides a fast alternative to simply redrawing when
the contents of the item (or parts of the item) are shifted
vertically or horizontally. Depending on the current transformation
and the capabilities of the paint device (i.e., the viewport), this
operation may consist of simply moving pixels from one location to
another using memmove(). In most cases this is faster than
rerendering the entire area.</p>
<p>After scrolling, the item will issue an update for the newly
exposed areas. If scrolling is not supported (e.g., you are
rendering to an OpenGL viewport, which does not benefit from scroll
optimizations), this function is equivalent to calling
update(<i>rect</i>).</p>
<p><b>Note:</b> Scrolling is only supported when <a href="qgraphicsitem.html#CacheMode-enum">QGraphicsItem.ItemCoordinateCache</a>
is enabled; in all other cases calling this function is equivalent
to calling update(<i>rect</i>). If you for sure know that the item
is opaque and not overlapped by other items, you can map the
<i>rect</i> to viewport coordinates and scroll the viewport.</p>
<pre class="cpp">
 <span class="type"><a href="qtransform.html">QTransform</a></span> xform <span class="operator">=</span> item<span class="operator">-</span><span class="operator">&gt;</span><a href="qgraphicsitem.html#deviceTransform">deviceTransform</a>(view<span class="operator">-</span><span class="operator">&gt;</span>viewportTransform());
 <span class="type"><a href="qrect.html">QRect</a></span> deviceRect <span class="operator">=</span> xform<span class="operator">.</span>mapRect(rect)<span class="operator">.</span>toAlignedRect();
 view<span class="operator">-</span><span class="operator">&gt;</span>viewport()<span class="operator">-</span><span class="operator">&gt;</span>scroll(dx<span class="operator">,</span> dy<span class="operator">,</span> deviceRect);
</pre>
<p>This function was introduced in Qt 4.4.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#boundingRect">boundingRect</a>().</p>


<h3 class="fn"><a name="setAcceptDrops" />QGraphicsItem.setAcceptDrops (<i>self</i>, bool&#160;<i>on</i>)</h3><p>If <i>on</i> is true, this item will accept drag and drop
events; otherwise, it is transparent for drag and drop events. By
default, items do not accept drag and drop events.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#acceptDrops">acceptDrops</a>().</p>


<h3 class="fn"><a name="setAcceptedMouseButtons" />QGraphicsItem.setAcceptedMouseButtons (<i>self</i>, <a href="qt-mousebuttons.html">Qt.MouseButtons</a>&#160;<i>buttons</i>)</h3><p>Sets the mouse <i>buttons</i> that this item accepts mouse
events for.</p>
<p>By default, all mouse buttons are accepted. If an item accepts a
mouse button, it will become the mouse grabber item when a mouse
press event is delivered for that button. However, if the item does
not accept the mouse button, <a href="qgraphicsscene.html">QGraphicsScene</a> will forward the mouse
events to the first item beneath it that does.</p>
<p>To disable mouse events for an item (i.e., make it transparent
for mouse events), call setAcceptedMouseButtons(0).</p>
<p><b>See also</b> <a href="qgraphicsitem.html#acceptedMouseButtons">acceptedMouseButtons</a>()
and <a href="qgraphicsitem.html#mousePressEvent">mousePressEvent</a>().</p>


<h3 class="fn"><a name="setAcceptHoverEvents" />QGraphicsItem.setAcceptHoverEvents (<i>self</i>, bool&#160;<i>enabled</i>)</h3><p>If <i>enabled</i> is true, this item will accept hover events;
otherwise, it will ignore them. By default, items do not accept
hover events.</p>
<p>Hover events are delivered when there is no current mouse
grabber item. They are sent when the mouse cursor enters an item,
when it moves around inside the item, and when the cursor leaves an
item. Hover events are commonly used to highlight an item when it's
entered, and for tracking the mouse cursor as it hovers over the
item (equivalent to <a href="qwidget.html#mouseTracking-prop">QWidget.mouseTracking</a>).</p>
<p>Parent items receive hover enter events before their children,
and leave events after their children. The parent does not receive
a hover leave event if the cursor enters a child, though; the
parent stays "hovered" until the cursor leaves its area, including
its children's areas.</p>
<p>If a parent item handles child events, it will receive hover
move, drag move, and drop events as the cursor passes through its
children, but it does not receive hover enter and hover leave, nor
drag enter and drag leave events on behalf of its children.</p>
<p>A <a href="qgraphicswidget.html">QGraphicsWidget</a> with window
decorations will accept hover events regardless of the value of
<a href="qgraphicsitem.html#acceptHoverEvents">acceptHoverEvents</a>().</p>
<p>This function was introduced in Qt 4.4.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#acceptHoverEvents">acceptHoverEvents</a>(),
<a href="qgraphicsitem.html#hoverEnterEvent">hoverEnterEvent</a>(),
<a href="qgraphicsitem.html#hoverMoveEvent">hoverMoveEvent</a>(),
and <a href="qgraphicsitem.html#hoverLeaveEvent">hoverLeaveEvent</a>().</p>


<h3 class="fn"><a name="setAcceptsHoverEvents" />QGraphicsItem.setAcceptsHoverEvents (<i>self</i>, bool&#160;<i>enabled</i>)</h3><h3 class="fn"><a name="setAcceptTouchEvents" />QGraphicsItem.setAcceptTouchEvents (<i>self</i>, bool&#160;<i>enabled</i>)</h3><p>If <i>enabled</i> is true, this item will accept <a href="qtouchevent.html">touch events</a>; otherwise, it will ignore
them. By default, items do not accept touch events.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#acceptTouchEvents">acceptTouchEvents</a>().</p>


<h3 class="fn"><a name="setActive" />QGraphicsItem.setActive (<i>self</i>, bool&#160;<i>active</i>)</h3><p>If <i>active</i> is true, and the scene is active, this item's
panel will be activated. Otherwise, the panel is deactivated.</p>
<p>If the item is not part of an active scene, <i>active</i> will
decide what happens to the panel when the scene becomes active or
the item is added to the scene. If true, the item's panel will be
activated when the item is either added to the scene or the scene
is activated. Otherwise, the item will stay inactive independent of
the scene's activated state.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#isPanel">isPanel</a>(), <a href="qgraphicsscene.html#setActivePanel">QGraphicsScene.setActivePanel</a>(),
and <a href="qgraphicsscene.html#isActive">QGraphicsScene.isActive</a>().</p>


<h3 class="fn"><a name="setBoundingRegionGranularity" />QGraphicsItem.setBoundingRegionGranularity (<i>self</i>, float&#160;<i>granularity</i>)</h3><p>Sets the bounding region granularity to <i>granularity</i>; a
value between and including 0 and 1. The default value is 0 (i.e.,
the lowest granularity, where the bounding region corresponds to
the item's bounding rectangle).</p>
<p>The granularity is used by <a href="qgraphicsitem.html#boundingRegion">boundingRegion</a>() to
calculate how fine the bounding region of the item should be. The
highest achievable granularity is 1, where <a href="qgraphicsitem.html#boundingRegion">boundingRegion</a>() will
return the finest outline possible for the respective device (e.g.,
for a <a href="qgraphicsview.html">QGraphicsView</a> viewport, this
gives you a pixel-perfect bounding region). The lowest possible
granularity is 0. The value of <i>granularity</i> describes the
ratio between device resolution and the resolution of the bounding
region (e.g., a value of 0.25 will provide a region where each
chunk corresponds to 4x4 device units / pixels).</p>
<p>This function was introduced in Qt 4.4.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#boundingRegionGranularity">boundingRegionGranularity</a>().</p>


<h3 class="fn"><a name="setCacheMode" />QGraphicsItem.setCacheMode (<i>self</i>, <a href="qgraphicsitem.html#CacheMode-enum">CacheMode</a>&#160;<i>mode</i>, <a href="qsize.html">QSize</a>&#160;<i>logicalCacheSize</i>&#160;=&#160;QSize())</h3><p>Sets the item's cache mode to <i>mode</i>.</p>
<p>The optional <i>logicalCacheSize</i> argument is used only by
<a href="qgraphicsitem.html#CacheMode-enum">ItemCoordinateCache</a>
mode, and describes the resolution of the cache buffer; if
<i>logicalCacheSize</i> is (100, 100), <a href="qgraphicsitem.html">QGraphicsItem</a> will fit the item into
100x100 pixels in graphics memory, regardless of the logical size
of the item itself. By default <a href="qgraphicsitem.html">QGraphicsItem</a> uses the size of <a href="qgraphicsitem.html#boundingRect">boundingRect</a>(). For all other
cache modes than <a href="qgraphicsitem.html#CacheMode-enum">ItemCoordinateCache</a>,
<i>logicalCacheSize</i> is ignored.</p>
<p>Caching can speed up rendering if your item spends a significant
time redrawing itself. In some cases the cache can also slow down
rendering, in particular when the item spends less time redrawing
than <a href="qgraphicsitem.html">QGraphicsItem</a> spends
redrawing from the cache. When enabled, the item's <a href="qgraphicsitem.html#paint">paint</a>() function will be called only
once for each call to <a href="qgraphicsitem.html#update">update</a>(); for any subsequent
repaint requests, the Graphics View framework will redraw from the
cache. This approach works particularly well with <a href="qglwidget.html">QGLWidget</a>, which stores all the cache as
OpenGL textures.</p>
<p>Be aware that <a href="qpixmapcache.html">QPixmapCache</a>'s
cache limit may need to be changed to obtain optimal
performance.</p>
<p>You can read more about the different cache modes in the
<a href="qgraphicsitem.html#CacheMode-enum">CacheMode</a>
documentation.</p>
<p>This function was introduced in Qt 4.4.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#cacheMode">cacheMode</a>(), <a href="qgraphicsitem.html#CacheMode-enum">CacheMode</a>, and <a href="qpixmapcache.html#setCacheLimit">QPixmapCache.setCacheLimit</a>().</p>


<h3 class="fn"><a name="setCursor" />QGraphicsItem.setCursor (<i>self</i>, <a href="qcursor.html">QCursor</a>&#160;<i>cursor</i>)</h3><p>Sets the current cursor shape for the item to <i>cursor</i>. The
mouse cursor will assume this shape when it's over this item. See
the <a href="qt.html#CursorShape-enum">list of predefined cursor
objects</a> for a range of useful shapes.</p>
<p>An editor item might want to use an I-beam cursor:</p>
<pre class="cpp">
 item<span class="operator">-</span><span class="operator">&gt;</span>setCursor(<span class="type"><a href="qt.html">Qt</a></span><span class="operator">.</span>IBeamCursor);
</pre>
<p>If no cursor has been set, the cursor of the item beneath is
used.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#cursor">cursor</a>(), <a href="qgraphicsitem.html#hasCursor">hasCursor</a>(), <a href="qgraphicsitem.html#unsetCursor">unsetCursor</a>(), <a href="qwidget.html#cursor-prop">QWidget.cursor</a>, and <a href="qapplication.html#overrideCursor">QApplication.overrideCursor</a>().</p>


<h3 class="fn"><a name="setData" />QGraphicsItem.setData (<i>self</i>, int&#160;<i>key</i>, QVariant&#160;<i>value</i>)</h3><p>Sets this item's custom data for the key <i>key</i> to
<i>value</i>.</p>
<p>Custom item data is useful for storing arbitrary properties for
any item. Qt does not use this feature for storing data; it is
provided solely for the convenience of the user.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#data">data</a>().</p>


<h3 class="fn"><a name="setEnabled" />QGraphicsItem.setEnabled (<i>self</i>, bool&#160;<i>enabled</i>)</h3><p>If <i>enabled</i> is true, the item is enabled; otherwise, it is
disabled.</p>
<p>Disabled items are visible, but they do not receive any events,
and cannot take focus nor be selected. Mouse events are discarded;
they are not propagated unless the item is also invisible, or if it
does not accept mouse events (see <a href="qgraphicsitem.html#acceptedMouseButtons">acceptedMouseButtons</a>()).
A disabled item cannot become the mouse grabber, and as a result of
this, an item loses the grab if it becomes disabled when grabbing
the mouse, just like it loses focus if it had focus when it was
disabled.</p>
<p>Disabled items are traditionally drawn using grayed-out colors
(see <a href="qpalette.html#ColorGroup-enum">QPalette.Disabled</a>).</p>
<p>If you disable a parent item, all its children will also be
disabled. If you enable a parent item, all children will be
enabled, unless they have been explicitly disabled (i.e., if you
call setEnabled(false) on a child, it will not be reenabled if its
parent is disabled, and then enabled again).</p>
<p>Items are enabled by default.</p>
<p><b>Note:</b> If you install an event filter, you can still
intercept events before they are delivered to items; this mechanism
disregards the item's enabled state.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#isEnabled">isEnabled</a>().</p>


<h3 class="fn"><a name="setFiltersChildEvents" />QGraphicsItem.setFiltersChildEvents (<i>self</i>, bool&#160;<i>enabled</i>)</h3><p>If <i>enabled</i> is true, this item is set to filter all events
for all its children (i.e., all events intented for any of its
children are instead sent to this item); otherwise, if
<i>enabled</i> is false, this item will only handle its own events.
The default value is false.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#filtersChildEvents">filtersChildEvents</a>().</p>


<h3 class="fn"><a name="setFlag" />QGraphicsItem.setFlag (<i>self</i>, <a href="qgraphicsitem.html#GraphicsItemFlag-enum">GraphicsItemFlag</a>&#160;<i>flag</i>, bool&#160;<i>enabled</i>&#160;=&#160;True)</h3><p>If <i>enabled</i> is true, the item flag <i>flag</i> is enabled;
otherwise, it is disabled.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#flags">flags</a>()
and <a href="qgraphicsitem.html#setFlags">setFlags</a>().</p>


<h3 class="fn"><a name="setFlags" />QGraphicsItem.setFlags (<i>self</i>, <a href="qgraphicsitem-graphicsitemflags.html">GraphicsItemFlags</a>&#160;<i>flags</i>)</h3><p>Sets the item flags to <i>flags</i>. All flags in <i>flags</i>
are enabled; all flags not in <i>flags</i> are disabled.</p>
<p>If the item had focus and <i>flags</i> does not enable <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemIsFocusable</a>, the
item loses focus as a result of calling this function. Similarly,
if the item was selected, and <i>flags</i> does not enabled
<a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemIsSelectable</a>,
the item is automatically unselected.</p>
<p>By default, no flags are enabled. (<a href="qgraphicswidget.html">QGraphicsWidget</a> enables the <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemSendsGeometryChanges</a>
flag by default in order to track position changes.)</p>
<p><b>See also</b> <a href="qgraphicsitem.html#flags">flags</a>()
and <a href="qgraphicsitem.html#setFlag">setFlag</a>().</p>


<h3 class="fn"><a name="setFocus" />QGraphicsItem.setFocus (<i>self</i>, <a href="qt.html#FocusReason-enum">Qt.FocusReason</a>&#160;<i>focusReason</i>&#160;=&#160;Qt.OtherFocusReason)</h3><p>Gives keyboard input focus to this item. The <i>focusReason</i>
argument will be passed into any <a href="qfocusevent.html">focus
event</a> generated by this function; it is used to give an
explanation of what caused the item to get focus.</p>
<p>Only enabled items that set the <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemIsFocusable</a> flag
can accept keyboard focus.</p>
<p>If this item is not visible, not active, or not associated with
a scene, it will not gain immediate input focus. However, it will
be registered as the preferred focus item for its subtree of items,
should it later become visible.</p>
<p>As a result of calling this function, this item will receive a
<a href="qgraphicsitem.html#focusInEvent">focus in event</a> with
<i>focusReason</i>. If another item already has focus, that item
will first receive a <a href="qgraphicsitem.html#focusOutEvent">focus out event</a> indicating
that it has lost input focus.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#clearFocus">clearFocus</a>(), <a href="qgraphicsitem.html#hasFocus">hasFocus</a>(), <a href="qgraphicsitem.html#focusItem">focusItem</a>(), and <a href="qgraphicsitem.html#focusProxy">focusProxy</a>().</p>


<h3 class="fn"><a name="setFocusProxy" />QGraphicsItem.setFocusProxy (<i>self</i>, <a href="qgraphicsitem.html">QGraphicsItem</a>&#160;<i>item</i>)</h3><p>Sets the item's focus proxy to <i>item</i>.</p>
<p>If an item has a focus proxy, the focus proxy will receive input
focus when the item gains input focus. The item itself will still
have focus (i.e., <a href="qgraphicsitem.html#hasFocus">hasFocus</a>() will return true), but
only the focus proxy will receive the keyboard input.</p>
<p>A focus proxy can itself have a focus proxy, and so on. In such
case, keyboard input will be handled by the outermost focus
proxy.</p>
<p>The focus proxy <i>item</i> must belong to the same scene as
this item.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#focusProxy">focusProxy</a>(), <a href="qgraphicsitem.html#setFocus">setFocus</a>(), and <a href="qgraphicsitem.html#hasFocus">hasFocus</a>().</p>


<h3 class="fn"><a name="setGraphicsEffect" />QGraphicsItem.setGraphicsEffect (<i>self</i>, <a href="qgraphicseffect.html">QGraphicsEffect</a>&#160;<i>effect</i>)</h3><p>The <i>effect</i> argument has it's ownership transferred to Qt.</p><p>Sets <i>effect</i> as the item's effect. If there already is an
effect installed on this item, <a href="qgraphicsitem.html">QGraphicsItem</a> will delete the existing
effect before installing the new <i>effect</i>.</p>
<p>If <i>effect</i> is the installed on a different item,
setGraphicsEffect() will remove the effect from the item and
install it on this item.</p>
<p><a href="qgraphicsitem.html">QGraphicsItem</a> takes ownership
of <i>effect</i>.</p>
<p><b>Note:</b> This function will apply the effect on itself and
all its children.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#graphicsEffect">graphicsEffect</a>().</p>


<h3 class="fn"><a name="setGroup" />QGraphicsItem.setGroup (<i>self</i>, <a href="qgraphicsitemgroup.html">QGraphicsItemGroup</a>&#160;<i>group</i>)</h3><p>Adds this item to the item group <i>group</i>. If <i>group</i>
is 0, this item is removed from any current group and added as a
child of the previous group's parent.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#group">group</a>()
and <a href="qgraphicsscene.html#createItemGroup">QGraphicsScene.createItemGroup</a>().</p>


<h3 class="fn"><a name="setHandlesChildEvents" />QGraphicsItem.setHandlesChildEvents (<i>self</i>, bool&#160;<i>enabled</i>)</h3><h3 class="fn"><a name="setInputMethodHints" />QGraphicsItem.setInputMethodHints (<i>self</i>, <a href="qt-inputmethodhints.html">Qt.InputMethodHints</a>&#160;<i>hints</i>)</h3><p>Sets the current input method hints of this item to
<i>hints</i>.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#inputMethodHints">inputMethodHints</a>(),
<a href="qgraphicsitem.html#inputMethodQuery">inputMethodQuery</a>(), and
<a href="qinputcontext.html">QInputContext</a>.</p>


<h3 class="fn"><a name="setMatrix" />QGraphicsItem.setMatrix (<i>self</i>, <a href="qmatrix.html">QMatrix</a>&#160;<i>matrix</i>, bool&#160;<i>combine</i>&#160;=&#160;False)</h3><h3 class="fn"><a name="setOpacity" />QGraphicsItem.setOpacity (<i>self</i>, float&#160;<i>opacity</i>)</h3><p>Sets this item's local <i>opacity</i>, between 0.0 (transparent)
and 1.0 (opaque). The item's local opacity is combined with parent
and ancestor opacities into the <a href="qgraphicsitem.html#effectiveOpacity">effectiveOpacity</a>().</p>
<p>By default, opacity propagates from parent to child, so if a
parent's opacity is 0.5 and the child is also 0.5, the child's
effective opacity will be 0.25.</p>
<p>The opacity property decides the state of the painter passed to
the <a href="qgraphicsitem.html#paint">paint</a>() function. If the
item is cached, i.e., <a href="qgraphicsitem.html#CacheMode-enum">ItemCoordinateCache</a> or
<a href="qgraphicsitem.html#CacheMode-enum">DeviceCoordinateCache</a>, the
effective property will be applied to the item's cache as it is
rendered.</p>
<p>There are two item flags that affect how the item's opacity is
combined with the parent: <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemIgnoresParentOpacity</a>
and <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemDoesntPropagateOpacityToChildren</a>.</p>
<p>This function was introduced in Qt 4.5.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#opacity">opacity</a>() and <a href="qgraphicsitem.html#effectiveOpacity">effectiveOpacity</a>().</p>


<h3 class="fn"><a name="setPanelModality" />QGraphicsItem.setPanelModality (<i>self</i>, <a href="qgraphicsitem.html#PanelModality-enum">PanelModality</a>&#160;<i>panelModality</i>)</h3><p>Sets the modality for this item to <i>panelModality</i>.</p>
<p>Changing the modality of a visible item takes effect
immediately.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#panelModality">panelModality</a>().</p>


<h3 class="fn"><a name="setParentItem" />QGraphicsItem.setParentItem (<i>self</i>, <a href="qgraphicsitem.html">QGraphicsItem</a>&#160;<i>parent</i>)</h3><p>The <i>parent</i> argument, if not None, causes <i>self</i> to be owned by Qt instead of PyQt.</p><p>Sets this item's parent item to <i>newParent</i>. If this item
already has a parent, it is first removed from the previous parent.
If <i>newParent</i> is 0, this item will become a top-level
item.</p>
<p>Note that this implicitly adds this graphics item to the scene
of the parent. You should not <a href="qgraphicsscene.html#addItem">add</a> the item to the scene
yourself.</p>
<p>Calling this function on an item that is an ancestor of
<i>newParent</i> have undefined behaviour.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#parentItem">parentItem</a>() and <a href="qgraphicsitem.html#childItems">childItems</a>().</p>


<h3 class="fn"><a name="setPos" />QGraphicsItem.setPos (<i>self</i>, <a href="qpointf.html">QPointF</a>&#160;<i>pos</i>)</h3><p>Sets the position of the item to <i>pos</i>, which is in parent
coordinates. For items with no parent, <i>pos</i> is in scene
coordinates.</p>
<p>The position of the item describes its origin (local coordinate
(0, 0)) in parent coordinates.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#pos">pos</a>(),
<a href="qgraphicsitem.html#scenePos">scenePos</a>(), and <a href="graphicsview.html#the-graphics-view-coordinate-system">The
Graphics View Coordinate System</a>.</p>


<h3 class="fn"><a name="setPos-2" />QGraphicsItem.setPos (<i>self</i>, float&#160;<i>ax</i>, float&#160;<i>ay</i>)</h3><p>This is an overloaded function.</p>
<p>This convenience function is equivalent to calling
setPos(<a href="qpointf.html">QPointF</a>(<i>x</i>, <i>y</i>)).</p>


<h3 class="fn"><a name="setRotation" />QGraphicsItem.setRotation (<i>self</i>, float&#160;<i>angle</i>)</h3><p>Sets the clockwise rotation <i>angle</i>, in degrees, around the
Z axis. The default value is 0 (i.e., the item is not rotated).
Assigning a negative value will rotate the item counter-clockwise.
Normally the rotation angle is in the range (-360, 360), but it's
also possible to assign values outside of this range (e.g., a
rotation of 370 degrees is the same as a rotation of 10
degrees).</p>
<p>The item is rotated around its transform origin point, which by
default is (0, 0). You can select a different transformation origin
by calling <a href="qgraphicsitem.html#setTransformOriginPoint">setTransformOriginPoint</a>().</p>
<p>The rotation is combined with the item's <a href="qgraphicsitem.html#scale">scale</a>(), <a href="qgraphicsitem.html#transform">transform</a>() and <a href="qgraphicsitem.html#transformations">transformations</a>() to map
the item's coordinate system to the parent item.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#rotation">rotation</a>(), <a href="qgraphicsitem.html#setTransformOriginPoint">setTransformOriginPoint</a>(),
and <a href="qgraphicsitem.html#transformations">Transformations</a>.</p>


<h3 class="fn"><a name="setScale" />QGraphicsItem.setScale (<i>self</i>, float&#160;<i>scale</i>)</h3><p>Sets the scale <i>factor</i> of the item. The default scale
factor is 1.0 (i.e., the item is not scaled). A scale factor of 0.0
will collapse the item to a single point. If you provide a negative
scale factor, the item will be flipped and mirrored (i.e., rotated
180 degrees).</p>
<p>The item is scaled around its transform origin point, which by
default is (0, 0). You can select a different transformation origin
by calling <a href="qgraphicsitem.html#setTransformOriginPoint">setTransformOriginPoint</a>().</p>
<p>The scale is combined with the item's <a href="qgraphicsitem.html#rotation">rotation</a>(), <a href="qgraphicsitem.html#transform">transform</a>() and <a href="qgraphicsitem.html#transformations">transformations</a>() to map
the item's coordinate system to the parent item.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#scale">scale</a>(),
<a href="qgraphicsitem.html#setTransformOriginPoint">setTransformOriginPoint</a>(),
and <a href="painting-transformations.html">Transformations
Example</a>.</p>


<h3 class="fn"><a name="setSelected" />QGraphicsItem.setSelected (<i>self</i>, bool&#160;<i>selected</i>)</h3><p>If <i>selected</i> is true and this item is selectable, this
item is selected; otherwise, it is unselected.</p>
<p>If the item is in a group, the whole group's selected state is
toggled by this function. If the group is selected, all items in
the group are also selected, and if the group is not selected, no
item in the group is selected.</p>
<p>Only visible, enabled, selectable items can be selected. If
<i>selected</i> is true and this item is either invisible or
disabled or unselectable, this function does nothing.</p>
<p>By default, items cannot be selected. To enable selection, set
the <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemIsSelectable</a>
flag.</p>
<p>This function is provided for convenience, allowing individual
toggling of the selected state of an item. However, a more common
way of selecting items is to call <a href="qgraphicsscene.html#setSelectionArea">QGraphicsScene.setSelectionArea</a>(),
which will call this function for all visible, enabled, and
selectable items within a specified area on the scene.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#isSelected">isSelected</a>() and <a href="qgraphicsscene.html#selectedItems">QGraphicsScene.selectedItems</a>().</p>


<h3 class="fn"><a name="setToolTip" />QGraphicsItem.setToolTip (<i>self</i>, QString&#160;<i>toolTip</i>)</h3><p>Sets the item's tool tip to <i>toolTip</i>. If <i>toolTip</i> is
empty, the item's tool tip is cleared.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#toolTip">toolTip</a>() and <a href="qtooltip.html">QToolTip</a>.</p>


<h3 class="fn"><a name="setTransform" />QGraphicsItem.setTransform (<i>self</i>, <a href="qtransform.html">QTransform</a>&#160;<i>matrix</i>, bool&#160;<i>combine</i>&#160;=&#160;False)</h3><p>Sets the item's current transformation matrix to
<i>matrix</i>.</p>
<p>If <i>combine</i> is true, then <i>matrix</i> is combined with
the current matrix; otherwise, <i>matrix</i> <i>replaces</i> the
current matrix. <i>combine</i> is false by default.</p>
<p>To simplify interation with items using a transformed view,
<a href="qgraphicsitem.html">QGraphicsItem</a> provides mapTo...
and mapFrom... functions that can translate between items' and the
scene's coordinates. For example, you can call <a href="qgraphicsitem.html#mapToScene">mapToScene</a>() to map an item
coordiate to a scene coordinate, or <a href="qgraphicsitem.html#mapFromScene">mapFromScene</a>() to map from
scene coordinates to item coordinates.</p>
<p>The transformation matrix is combined with the item's <a href="qgraphicsitem.html#rotation">rotation</a>(), <a href="qgraphicsitem.html#scale">scale</a>() and <a href="qgraphicsitem.html#transformations">transformations</a>() into a
combined transformation that maps the item's coordinate system to
its parent.</p>
<p>This function was introduced in Qt 4.3.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#transform">transform</a>(), <a href="qgraphicsitem.html#setRotation">setRotation</a>(), <a href="qgraphicsitem.html#setScale">setScale</a>(), <a href="qgraphicsitem.html#setTransformOriginPoint">setTransformOriginPoint</a>(),
<a href="graphicsview.html#the-graphics-view-coordinate-system">The
Graphics View Coordinate System</a>, and <a href="qgraphicsitem.html#transformations">Transformations</a>.</p>


<h3 class="fn"><a name="setTransformations" />QGraphicsItem.setTransformations (<i>self</i>, list-of-QGraphicsTransform&#160;<i>transformations</i>)</h3><p>Sets a list of graphics <i>transformations</i> (<a href="qgraphicstransform.html">QGraphicsTransform</a>) that currently
apply to this item.</p>
<p>If all you want is to rotate or scale an item, you should call
<a href="qgraphicsitem.html#setRotation">setRotation</a>() or
<a href="qgraphicsitem.html#setScale">setScale</a>() instead. If
you want to set an arbitrary transformation on an item, you can
call <a href="qgraphicsitem.html#setTransform">setTransform</a>().</p>
<p><a href="qgraphicstransform.html">QGraphicsTransform</a> is for
applying and controlling a chain of individual transformation
operations on an item. It's particularly useful in animations,
where each transform operation needs to be interpolated
independently, or differently.</p>
<p>The transformations are combined with the item's <a href="qgraphicsitem.html#rotation">rotation</a>(), <a href="qgraphicsitem.html#scale">scale</a>() and <a href="qgraphicsitem.html#transform">transform</a>() to map the item's
coordinate system to the parent item.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#transformations">transformations</a>(),
<a href="qgraphicsitem.html#scale">scale</a>(), <a href="qgraphicsitem.html#setTransformOriginPoint">setTransformOriginPoint</a>(),
and <a href="qgraphicsitem.html#transformations">Transformations</a>.</p>


<h3 class="fn"><a name="setTransformOriginPoint" />QGraphicsItem.setTransformOriginPoint (<i>self</i>, <a href="qpointf.html">QPointF</a>&#160;<i>origin</i>)</h3><p>Sets the <i>origin</i> point for the transformation in item
coordinates.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#transformOriginPoint">transformOriginPoint</a>()
and <a href="qgraphicsitem.html#transformations">Transformations</a>.</p>


<h3 class="fn"><a name="setTransformOriginPoint-2" />QGraphicsItem.setTransformOriginPoint (<i>self</i>, float&#160;<i>ax</i>, float&#160;<i>ay</i>)</h3><p>This is an overloaded function.</p>
<p>Sets the origin point for the transformation in item
coordinates. This is equivalent to calling
setTransformOriginPoint(<a href="qpointf.html">QPointF</a>(<i>x</i>, <i>y</i>)).</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#setTransformOriginPoint">setTransformOriginPoint</a>()
and <a href="qgraphicsitem.html#transformations">Transformations</a>.</p>


<h3 class="fn"><a name="setVisible" />QGraphicsItem.setVisible (<i>self</i>, bool&#160;<i>visible</i>)</h3><p>If <i>visible</i> is true, the item is made visible. Otherwise,
the item is made invisible. Invisible items are not painted, nor do
they receive any events. In particular, mouse events pass right
through invisible items, and are delivered to any item that may be
behind. Invisible items are also unselectable, they cannot take
input focus, and are not detected by <a href="qgraphicsscene.html">QGraphicsScene</a>'s item location
functions.</p>
<p>If an item becomes invisible while grabbing the mouse, (i.e.,
while it is receiving mouse events,) it will automatically lose the
mouse grab, and the grab is not regained by making the item visible
again; it must receive a new mouse press to regain the mouse
grab.</p>
<p>Similarly, an invisible item cannot have focus, so if the item
has focus when it becomes invisible, it will lose focus, and the
focus is not regained by simply making the item visible again.</p>
<p>If you hide a parent item, all its children will also be hidden.
If you show a parent item, all children will be shown, unless they
have been explicitly hidden (i.e., if you call setVisible(false) on
a child, it will not be reshown even if its parent is hidden, and
then shown again).</p>
<p>Items are visible by default; it is unnecessary to call
setVisible() on a new item.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#isVisible">isVisible</a>(), <a href="qgraphicsitem.html#show">show</a>(), and <a href="qgraphicsitem.html#hide">hide</a>().</p>


<h3 class="fn"><a name="setX" />QGraphicsItem.setX (<i>self</i>, float&#160;<i>x</i>)</h3><p>Set's the <i>x</i> coordinate of the item's position. Equivalent
to calling setPos(x, <a href="qgraphicsitem.html#y">y</a>()).</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#x">x</a>() and
<a href="qgraphicsitem.html#setPos">setPos</a>().</p>


<h3 class="fn"><a name="setY" />QGraphicsItem.setY (<i>self</i>, float&#160;<i>y</i>)</h3><p>Set's the <i>y</i> coordinate of the item's position. Equivalent
to calling setPos(<a href="qgraphicsitem.html#x">x</a>(), y).</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#y">y</a>(), <a href="qgraphicsitem.html#x">x</a>(), and <a href="qgraphicsitem.html#setPos">setPos</a>().</p>


<h3 class="fn"><a name="setZValue" />QGraphicsItem.setZValue (<i>self</i>, float&#160;<i>z</i>)</h3><p>Sets the Z-value of the item to <i>z</i>. The Z value decides
the stacking order of sibling (neighboring) items. A sibling item
of high Z value will always be drawn on top of another sibling item
with a lower Z value.</p>
<p>If you restore the Z value, the item's insertion order will
decide its stacking order.</p>
<p>The Z-value does not affect the item's size in any way.</p>
<p>The default Z-value is 0.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#zValue">zValue</a>(), <a href="qgraphicsitem.html#sorting">Sorting</a>, <a href="qgraphicsitem.html#stackBefore">stackBefore</a>(), and <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemStacksBehindParent</a>.</p>


<h3 class="fn"><a name="shape" /><a href="qpainterpath.html">QPainterPath</a> QGraphicsItem.shape (<i>self</i>)</h3><p>Returns the shape of this item as a <a href="qpainterpath.html">QPainterPath</a> in local coordinates. The
shape is used for many things, including collision detection, hit
tests, and for the <a href="qgraphicsscene.html#items">QGraphicsScene.items</a>()
functions.</p>
<p>The default implementation calls <a href="qgraphicsitem.html#boundingRect">boundingRect</a>() to return a
simple rectangular shape, but subclasses can reimplement this
function to return a more accurate shape for non-rectangular items.
For example, a round item may choose to return an elliptic shape
for better collision detection. For example:</p>
<pre class="cpp">
 <span class="type"><a href="qpainterpath.html">QPainterPath</a></span> RoundItem<span class="operator">.</span>shape() <span class="keyword">const</span>
 {
     <span class="type"><a href="qpainterpath.html">QPainterPath</a></span> path;
     path<span class="operator">.</span>addEllipse(boundingRect());
     <span class="keyword">return</span> path;
 }
</pre>
<p>The outline of a shape can vary depending on the width and style
of the pen used when drawing. If you want to include this outline
in the item's shape, you can create a shape from the stroke using
<a href="qpainterpathstroker.html">QPainterPathStroker</a>.</p>
<p>This function is called by the default implementations of
<a href="qgraphicsitem.html#contains">contains</a>() and <a href="qgraphicsitem.html#collidesWithPath">collidesWithPath</a>().</p>
<p><b>See also</b> <a href="qgraphicsitem.html#boundingRect">boundingRect</a>(), <a href="qgraphicsitem.html#contains">contains</a>(), <a href="qgraphicsitem.html#prepareGeometryChange">prepareGeometryChange</a>(),
and <a href="qpainterpathstroker.html">QPainterPathStroker</a>.</p>


<h3 class="fn"><a name="shear" />QGraphicsItem.shear (<i>self</i>, float&#160;<i>sh</i>, float&#160;<i>sv</i>)</h3><h3 class="fn"><a name="show" />QGraphicsItem.show (<i>self</i>)</h3><p>Shows the item. (Items are visible by default.)</p>
<p>This convenience function is equivalent to calling
<tt>setVisible(true)</tt>.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#hide">hide</a>() and
<a href="qgraphicsitem.html#setVisible">setVisible</a>().</p>


<h3 class="fn"><a name="stackBefore" />QGraphicsItem.stackBefore (<i>self</i>, <a href="qgraphicsitem.html">QGraphicsItem</a>&#160;<i>sibling</i>)</h3><p>Stacks this item before <i>sibling</i>, which must be a sibling
item (i.e., the two items must share the same parent item, or must
both be toplevel items). The <i>sibling</i> must have the same Z
value as this item, otherwise calling this function will have no
effect.</p>
<p>By default, all sibling items are stacked by insertion order
(i.e., the first item you add is drawn before the next item you
add). If two items' Z values are different, then the item with the
highest Z value is drawn on top. When the Z values are the same,
the insertion order will decide the stacking order.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#setZValue">setZValue</a>(), <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemStacksBehindParent</a>,
and <a href="qgraphicsitem.html#sorting">Sorting</a>.</p>


<h3 class="fn"><a name="toGraphicsObject" /><a href="qgraphicsobject.html">QGraphicsObject</a> QGraphicsItem.toGraphicsObject (<i>self</i>)</h3><p>Return the graphics item cast to a <a href="qgraphicsobject.html">QGraphicsObject</a>, if the class is
actually a graphics object, 0 otherwise.</p>
<p>This function was introduced in Qt 4.6.</p>


<h3 class="fn"><a name="toolTip" />QString QGraphicsItem.toolTip (<i>self</i>)</h3><p>Returns the item's tool tip, or an empty <a href="qstring.html">QString</a> if no tool tip has been set.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#setToolTip">setToolTip</a>() and <a href="qtooltip.html">QToolTip</a>.</p>


<h3 class="fn"><a name="topLevelItem" /><a href="qgraphicsitem.html">QGraphicsItem</a> QGraphicsItem.topLevelItem (<i>self</i>)</h3><p>Returns this item's top-level item. The top-level item is the
item's topmost ancestor item whose parent is 0. If an item has no
parent, its own pointer is returned (i.e., a top-level item is its
own top-level item).</p>
<p><b>See also</b> <a href="qgraphicsitem.html#parentItem">parentItem</a>().</p>


<h3 class="fn"><a name="topLevelWidget" /><a href="qgraphicswidget.html">QGraphicsWidget</a> QGraphicsItem.topLevelWidget (<i>self</i>)</h3><p>Returns a pointer to the item's top level widget (i.e., the
item's ancestor whose parent is 0, or whose parent is not a
widget), or 0 if this item does not have a top level widget. If the
item is its own top level widget, this function returns a pointer
to the item itself.</p>
<p>This function was introduced in Qt 4.4.</p>


<h3 class="fn"><a name="transform" /><a href="qtransform.html">QTransform</a> QGraphicsItem.transform (<i>self</i>)</h3><p>Returns this item's transformation matrix.</p>
<p>The transformation matrix is combined with the item's <a href="qgraphicsitem.html#rotation">rotation</a>(), <a href="qgraphicsitem.html#scale">scale</a>() and <a href="qgraphicsitem.html#transformations">transformations</a>() into a
combined transformations for the item.</p>
<p>The default transformation matrix is an identity matrix.</p>
<p>This function was introduced in Qt 4.3.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#setTransform">setTransform</a>() and <a href="qgraphicsitem.html#sceneTransform">sceneTransform</a>().</p>


<h3 class="fn"><a name="transformations" />list-of-QGraphicsTransform QGraphicsItem.transformations (<i>self</i>)</h3><p>Returns a list of graphics transforms that currently apply to
this item.</p>
<p><a href="qgraphicstransform.html">QGraphicsTransform</a> is for
applying and controlling a chain of individual transformation
operations on an item. It's particularly useful in animations,
where each transform operation needs to be interpolated
independently, or differently.</p>
<p>The transformations are combined with the item's <a href="qgraphicsitem.html#rotation">rotation</a>(), <a href="qgraphicsitem.html#scale">scale</a>() and <a href="qgraphicsitem.html#transform">transform</a>() to map the item's
coordinate system to the parent item.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#setTransformations">setTransformations</a>(),
<a href="qgraphicsitem.html#scale">scale</a>(), <a href="qgraphicsitem.html#rotation">rotation</a>(), <a href="qgraphicsitem.html#transformOriginPoint">transformOriginPoint</a>(),
and <a href="qgraphicsitem.html#transformations">Transformations</a>.</p>


<h3 class="fn"><a name="transformOriginPoint" /><a href="qpointf.html">QPointF</a> QGraphicsItem.transformOriginPoint (<i>self</i>)</h3><p>Returns the origin point for the transformation in item
coordinates.</p>
<p>The default is <a href="qpointf.html">QPointF</a>(0,0).</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#setTransformOriginPoint">setTransformOriginPoint</a>()
and <a href="qgraphicsitem.html#transformations">Transformations</a>.</p>


<h3 class="fn"><a name="translate" />QGraphicsItem.translate (<i>self</i>, float&#160;<i>dx</i>, float&#160;<i>dy</i>)</h3><h3 class="fn"><a name="type" />int QGraphicsItem.type (<i>self</i>)</h3><p>Returns the type of an item as an int. All standard graphicsitem
classes are associated with a unique value; see <a href="qgraphicsitem.html#Type-var">QGraphicsItem.Type</a>. This type
information is used by <a href="qgraphicsitem.html#qgraphicsitem_cast">qgraphicsitem_cast</a>() to
distinguish between types.</p>
<p>The default implementation (in <a href="qgraphicsitem.html">QGraphicsItem</a>) returns <a href="qgraphicsitem.html#UserType-var">UserType</a>.</p>
<p>To enable use of <a href="qgraphicsitem.html#qgraphicsitem_cast">qgraphicsitem_cast</a>()
with a custom item, reimplement this function and declare a Type
enum value equal to your custom item's type. Custom items must
return a value larger than or equal to <a href="qgraphicsitem.html#UserType-var">UserType</a> (65536).</p>
<p>For example:</p>
<pre class="cpp">
 <span class="keyword">class</span> CustomItem : <span class="keyword">public</span> <span class="type"><a href="qgraphicsitem.html">QGraphicsItem</a></span>
 {
    <span class="operator">.</span><span class="operator">.</span><span class="operator">.</span>
    <span class="keyword">enum</span> { Type <span class="operator">=</span> UserType <span class="operator">+</span> <span class="number">1</span> };

    <span class="type">int</span> type() <span class="keyword">const</span>
    {
        <span class="comment">// Enable the use of qgraphicsitem_cast with this item.</span>
        <span class="keyword">return</span> Type;
    }
    <span class="operator">.</span><span class="operator">.</span><span class="operator">.</span>
 };
</pre>
<p><b>See also</b> <a href="qgraphicsitem.html#UserType-var">UserType</a>.</p>


<h3 class="fn"><a name="ungrabKeyboard" />QGraphicsItem.ungrabKeyboard (<i>self</i>)</h3><p>Releases the keyboard grab.</p>
<p>This function was introduced in Qt 4.4.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#grabKeyboard">grabKeyboard</a>() and <a href="qgraphicsitem.html#ungrabMouse">ungrabMouse</a>().</p>


<h3 class="fn"><a name="ungrabMouse" />QGraphicsItem.ungrabMouse (<i>self</i>)</h3><p>Releases the mouse grab.</p>
<p>This function was introduced in Qt 4.4.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#grabMouse">grabMouse</a>() and <a href="qgraphicsitem.html#ungrabKeyboard">ungrabKeyboard</a>().</p>


<h3 class="fn"><a name="unsetCursor" />QGraphicsItem.unsetCursor (<i>self</i>)</h3><p>Clears the cursor from this item.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#hasCursor">hasCursor</a>() and <a href="qgraphicsitem.html#setCursor">setCursor</a>().</p>


<h3 class="fn"><a name="update" />QGraphicsItem.update (<i>self</i>, <a href="qrectf.html">QRectF</a>&#160;<i>rect</i>&#160;=&#160;QRectF())</h3><p>Schedules a redraw of the area covered by <i>rect</i> in this
item. You can call this function whenever your item needs to be
redrawn, such as if it changes appearance or size.</p>
<p>This function does not cause an immediate paint; instead it
schedules a paint request that is processed by <a href="qgraphicsview.html">QGraphicsView</a> after control reaches the
event loop. The item will only be redrawn if it is visible in any
associated view.</p>
<p>As a side effect of the item being repainted, other items that
overlap the area <i>rect</i> may also be repainted.</p>
<p>If the item is invisible (i.e., <a href="qgraphicsitem.html#isVisible">isVisible</a>() returns false), this
function does nothing.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#paint">paint</a>()
and <a href="qgraphicsitem.html#boundingRect">boundingRect</a>().</p>


<h3 class="fn"><a name="update-2" />QGraphicsItem.update (<i>self</i>, float&#160;<i>ax</i>, float&#160;<i>ay</i>, float&#160;<i>width</i>, float&#160;<i>height</i>)</h3><p>This is an overloaded function.</p>
<p>This convenience function is equivalent to calling
update(<a href="qrectf.html">QRectF</a>(<i>x</i>, <i>y</i>,
<i>width</i>, <i>height</i>)).</p>


<h3 class="fn"><a name="updateMicroFocus" />QGraphicsItem.updateMicroFocus (<i>self</i>)</h3><p>Updates the item's micro focus.</p>
<p>This function was introduced in Qt 4.7.</p>
<p><b>See also</b> <a href="qinputcontext.html">QInputContext</a>.</p>


<h3 class="fn"><a name="wheelEvent" />QGraphicsItem.wheelEvent (<i>self</i>, <a href="qgraphicsscenewheelevent.html">QGraphicsSceneWheelEvent</a>&#160;<i>event</i>)</h3><p>This event handler, for event <i>event</i>, can be reimplemented
to receive wheel events for this item. If you reimplement this
function, <i>event</i> will be accepted by default.</p>
<p>If you ignore the event, (i.e., by calling <a href="qevent.html#ignore">QEvent.ignore</a>(),) it will propagate to
any item beneath this item. If no items accept the event, it will
be ignored by the scene, and propagate to the view (e.g., the
view's vertical scroll bar).</p>
<p>The default implementation ignores the event.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#sceneEvent">sceneEvent</a>().</p>


<h3 class="fn"><a name="window" /><a href="qgraphicswidget.html">QGraphicsWidget</a> QGraphicsItem.window (<i>self</i>)</h3><p>Returns the item's window, or 0 if this item does not have a
window. If the item is a window, it will return itself. Otherwise
it will return the closest ancestor that is a window.</p>
<p>This function was introduced in Qt 4.4.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#isWindow">QGraphicsWidget.isWindow</a>().</p>


<h3 class="fn"><a name="x" />float QGraphicsItem.x (<i>self</i>)</h3><p>This convenience function is equivalent to calling <a href="qgraphicsitem.html#pos">pos</a>().x().</p>
<p><b>See also</b> <a href="qgraphicsitem.html#setX">setX</a>() and
<a href="qgraphicsitem.html#y">y</a>().</p>


<h3 class="fn"><a name="y" />float QGraphicsItem.y (<i>self</i>)</h3><p>This convenience function is equivalent to calling <a href="qgraphicsitem.html#pos">pos</a>().y().</p>
<p><b>See also</b> <a href="qgraphicsitem.html#setY">setY</a>() and
<a href="qgraphicsitem.html#x">x</a>().</p>


<h3 class="fn"><a name="zValue" />float QGraphicsItem.zValue (<i>self</i>)</h3><p>Returns the Z-value of the item. The Z-value affects the
stacking order of sibling (neighboring) items.</p>
<p>The default Z-value is 0.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#setZValue">setZValue</a>(), <a href="qgraphicsitem.html#sorting">Sorting</a>, <a href="qgraphicsitem.html#stackBefore">stackBefore</a>(), and <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemStacksBehindParent</a>.</p>
<hr /><h2>Member Documentation</h2><h3 class="fn"><a name="UserType-var" />int UserType</h3><p>This member should be treated as a constant.</p><p>The lowest permitted type value for custom items (subclasses of
<a href="qgraphicsitem.html">QGraphicsItem</a> or any of the
standard items). This value is used in conjunction with a
reimplementation of <a href="qgraphicsitem.html#type">QGraphicsItem.type</a>() and declaring a
Type enum value. Example:</p>
<pre class="cpp">
 <span class="keyword">class</span> CustomItem : <span class="keyword">public</span> <span class="type"><a href="qgraphicsitem.html">QGraphicsItem</a></span>
 {
    <span class="operator">.</span><span class="operator">.</span><span class="operator">.</span>
    <span class="keyword">enum</span> { Type <span class="operator">=</span> UserType <span class="operator">+</span> <span class="number">1</span> };

    <span class="type">int</span> type() <span class="keyword">const</span>
    {
        <span class="comment">// Enable the use of qgraphicsitem_cast with this item.</span>
        <span class="keyword">return</span> Type;
    }
    <span class="operator">.</span><span class="operator">.</span><span class="operator">.</span>
 };
</pre>
<p><b>Note:</b> UserType = 65536</p>
<address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt&#160;4.9.1 for X11</td><td align="center" width="50%">Copyright &#169; <a href="http://www.riverbankcomputing.com">Riverbank&#160;Computing&#160;Ltd</a> and <a href="http://www.qtsoftware.com">Nokia</a> 2011</td><td align="right" width="25%">Qt&#160;4.8.0</td></tr></table></div></address></body></html>